Allow using the compiler as an ESM module (#4972)

pull/5295/head
Alex Rock 4 years ago committed by GitHub
parent 935caee269
commit cd95654a97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -99,12 +99,20 @@ export default [
json(),
ts_plugin
],
output: {
file: 'compiler.js',
format: is_publish ? 'umd' : 'cjs',
name: 'svelte',
sourcemap: true,
},
output: [
{
file: 'compiler.js',
format: is_publish ? 'umd' : 'cjs',
name: 'svelte',
sourcemap: true,
},
{
file: 'compiler.mjs',
format: 'esm',
name: 'svelte',
sourcemap: true,
}
],
external: is_publish
? []
: id => id === 'acorn' || id === 'magic-string' || id.startsWith('css-tree')

Loading…
Cancel
Save