Skip to content

Commit cd95654

Browse files
authored
Allow using the compiler as an ESM module (#4972)
1 parent 935caee commit cd95654

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

rollup.config.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,20 @@ export default [
9999
json(),
100100
ts_plugin
101101
],
102-
output: {
103-
file: 'compiler.js',
104-
format: is_publish ? 'umd' : 'cjs',
105-
name: 'svelte',
106-
sourcemap: true,
107-
},
102+
output: [
103+
{
104+
file: 'compiler.js',
105+
format: is_publish ? 'umd' : 'cjs',
106+
name: 'svelte',
107+
sourcemap: true,
108+
},
109+
{
110+
file: 'compiler.mjs',
111+
format: 'esm',
112+
name: 'svelte',
113+
sourcemap: true,
114+
}
115+
],
108116
external: is_publish
109117
? []
110118
: id => id === 'acorn' || id === 'magic-string' || id.startsWith('css-tree')

0 commit comments

Comments
 (0)