Allow using the compiler as an ESM module

pull/4972/head
Alex Rock Ancelet 5 years ago
parent 25e9e684f6
commit 4b63c9b135
No known key found for this signature in database
GPG Key ID: DB8FCFE0742BE19E

@ -99,12 +99,20 @@ export default [
json(), json(),
ts_plugin ts_plugin
], ],
output: { output: [
file: 'compiler.js', {
format: is_publish ? 'umd' : 'cjs', file: 'compiler.js',
name: 'svelte', format: is_publish ? 'umd' : 'cjs',
sourcemap: true, name: 'svelte',
}, 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