Skip to content

Commit 7c86dbd

Browse files
fix windows (#1495)
Co-authored-by: NullVoxPopuli <[email protected]>
1 parent e712ae3 commit 7c86dbd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

bin/run-types-tests.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { execSync } from 'child_process';
44
import { execa } from 'execa';
55
import yaml from 'js-yaml';
66
import { resolve } from 'path';
7+
import { fileURLToPath } from 'url';
78

8-
const __dirname = new URL('.', import.meta.url).pathname;
9+
const __dirname = fileURLToPath(new URL('.', import.meta.url));
910
const root = resolve(__dirname, '..');
1011

1112
async function main() {

packages/@glimmer-workspace/build/lib/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function typescript(pkg, config) {
110110
const EXTERNAL_OPTIONS = [
111111
['is', ['tslib', '@glimmer/local-debug-flags'], 'inline'],
112112
['is', ['@handlebars/parser', 'simple-html-tokenizer', 'babel-plugin-debug-macros'], 'external'],
113-
['startsWith', ['.', '/', '#', '@babel/runtime/'], 'inline'],
113+
['startsWith', ['.', '/', '#', '@babel/runtime/', process.cwd().replace(/\\/gu, '/')], 'inline'],
114114
['startsWith', ['@glimmer/', '@simple-dom/', '@babel/', 'node:'], 'external'],
115115
];
116116

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

0 commit comments

Comments
 (0)