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(), json(),
ts_plugin ts_plugin
], ],
output: { output: [
{
file: 'compiler.js', file: 'compiler.js',
format: is_publish ? 'umd' : 'cjs', format: is_publish ? 'umd' : 'cjs',
name: 'svelte', name: 'svelte',
sourcemap: true, sourcemap: true,
}, },
{
file: 'compiler.mjs',
format: 'esm',
name: 'svelte',
sourcemap: true,
}
],
external: is_publish external: is_publish
? [] ? []
: id => id === 'acorn' || id === 'magic-string' || id.startsWith('css-tree') : id => id === 'acorn' || id === 'magic-string' || id.startsWith('css-tree')

Loading…
Cancel
Save