Skip to content

Commit

Permalink
fix windows (#1495)
Browse files Browse the repository at this point in the history
Co-authored-by: NullVoxPopuli <[email protected]>
  • Loading branch information
patricklx and NullVoxPopuli authored Nov 27, 2023
1 parent e712ae3 commit 7c86dbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bin/run-types-tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { execSync } from 'child_process';
import { execa } from 'execa';
import yaml from 'js-yaml';
import { resolve } from 'path';
import { fileURLToPath } from 'url';

const __dirname = new URL('.', import.meta.url).pathname;
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const root = resolve(__dirname, '..');

async function main() {
Expand Down
3 changes: 2 additions & 1 deletion packages/@glimmer-workspace/build/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function typescript(pkg, config) {
const EXTERNAL_OPTIONS = [
['is', ['tslib', '@glimmer/local-debug-flags'], 'inline'],
['is', ['@handlebars/parser', 'simple-html-tokenizer', 'babel-plugin-debug-macros'], 'external'],
['startsWith', ['.', '/', '#', '@babel/runtime/'], 'inline'],
['startsWith', ['.', '/', '#', '@babel/runtime/', process.cwd().replace(/\\/gu, '/')], 'inline'],
['startsWith', ['@glimmer/', '@simple-dom/', '@babel/', 'node:'], 'external'],
];

Expand All @@ -119,6 +119,7 @@ const EXTERNAL_OPTIONS = [
* @returns {boolean | null}
*/
function matchExternals(id) {
id = id.replace(/\\/gu, '/');
for (const [operator, prefixes, kind] of EXTERNAL_OPTIONS) {
const result = match(id, operator, prefixes);

Expand Down

0 comments on commit 7c86dbd

Please sign in to comment.