Skip to content

Commit 770754c

Browse files
committed
fix: fixed build script supporting windows paths
1 parent 7d7a0f5 commit 770754c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

scripts/build.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const nativeNodeModulesPlugin = {
3939
loader: 'js',
4040
};
4141
}
42-
if (args.path.endsWith('fd-lock/index.js')) {
42+
if (args.path.endsWith(path.join('fd-lock', 'index.js'))) {
4343
return {
4444
contents: `
4545
const path = require('path');
@@ -59,7 +59,7 @@ const nativeNodeModulesPlugin = {
5959
loader: 'js',
6060
};
6161
}
62-
if (args.path.endsWith('sodium-native/index.js')) {
62+
if (args.path.endsWith(path.join('sodium-native', 'index.js'))) {
6363
return {
6464
contents: `
6565
const path = require('path');
@@ -132,7 +132,7 @@ async function main(argv = process.argv) {
132132
? {
133133
external: [],
134134
format: 'cjs',
135-
inject: [path.join(projectPath, './shims/import-meta-url-shim.mjs')],
135+
inject: [path.join(projectPath, 'shims', 'import-meta-url-shim.mjs')],
136136
// Fix import.meta.url in CJS output
137137
define: {
138138
'import.meta.url': '__import_meta_url',
@@ -142,7 +142,7 @@ async function main(argv = process.argv) {
142142
: {
143143
// External: externalDependencies,
144144
format: 'esm',
145-
inject: [path.join(projectPath, './shims/require-shim.mjs')],
145+
inject: [path.join(projectPath, 'shims', 'require-shim.mjs')],
146146
outExtension: { '.js': '.mjs' },
147147
};
148148

@@ -174,8 +174,8 @@ async function main(argv = process.argv) {
174174
childProcess.execFileSync(
175175
'mv',
176176
[
177-
`dist/polykeyWorkerManifest.${isPkg ? 'cjs' : 'mjs'}`,
178-
'dist/polykeyWorkerManifest.js',
177+
path.join('dist', `polykeyWorkerManifest.${isPkg ? 'cjs' : 'mjs'}`),
178+
path.join('dist', 'polykeyWorkerManifest.js'),
179179
],
180180
{
181181
stdio: ['inherit', 'inherit', 'inherit'],
@@ -187,8 +187,8 @@ async function main(argv = process.argv) {
187187
childProcess.execFileSync(
188188
'mv',
189189
[
190-
`dist/polykeyWorkerManifest.${isPkg ? 'cjs' : 'mjs'}.map`,
191-
'dist/polykeyWorkerManifest.js.map',
190+
path.join('dist', `polykeyWorkerManifest.${isPkg ? 'cjs' : 'mjs'}.map`),
191+
path.join('dist', 'polykeyWorkerManifest.js.map'),
192192
],
193193
{
194194
stdio: ['inherit', 'inherit', 'inherit'],

0 commit comments

Comments
 (0)