Skip to content

Commit 9e1c52b

Browse files
committed
fix: move define to transform.define in rolldown
1 parent 79547c1 commit 9e1c52b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

vite-plugin-mock-dev-server/src/compiler/rolldown.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ export async function transformWithRolldown(
6161
file: 'out.js',
6262
},
6363
platform: 'node',
64-
define: {
65-
...define,
66-
__dirname: JSON.stringify(dirname),
67-
__filename: JSON.stringify(filename),
68-
...isESM ? {} : { 'import.meta.url': JSON.stringify(pathToFileURL(filepath)) },
64+
transform: {
65+
define: {
66+
...define,
67+
__dirname: JSON.stringify(dirname),
68+
__filename: JSON.stringify(filename),
69+
...isESM ? {} : { 'import.meta.url': JSON.stringify(pathToFileURL(filepath)) },
70+
},
6971
},
7072
external(id) {
7173
if (isAlias(id))

0 commit comments

Comments
 (0)