fix build order

pull/2887/head
Richard Harris 5 years ago
parent 7777bf0d81
commit c70deee9cf

@ -21,31 +21,6 @@ const ts_plugin = is_publish
const external = id => id.startsWith('svelte/');
export default [
/* compiler.js */
{
input: 'src/compiler/index.ts',
plugins: [
replace({
__VERSION__: pkg.version
}),
resolve(),
commonjs({
include: ['node_modules/**']
}),
json(),
ts_plugin
],
output: {
file: 'compiler.js',
format: is_publish ? 'umd' : 'cjs',
name: 'svelte',
sourcemap: true,
},
external: is_publish
? []
: id => id === 'acorn' || id === 'magic-string' || id.startsWith('css-tree')
},
/* runtime */
{
input: `src/runtime/index.ts`,
@ -86,12 +61,37 @@ export default [
ts_plugin,
dir === 'internal' && {
generateBundle(options, bundle) {
const mod = bundle['internal.mjs'];
const mod = bundle['index.mjs'];
if (mod) {
fs.writeFileSync('src/compile/internal-exports.ts', `// This file is automatically generated\nexport default new Set(${JSON.stringify(mod.exports)});`);
fs.writeFileSync('src/compiler/compile/internal-exports.ts', `// This file is automatically generated\nexport default new Set(${JSON.stringify(mod.exports)});`);
}
}
}
]
}))
})),
/* compiler.js */
{
input: 'src/compiler/index.ts',
plugins: [
replace({
__VERSION__: pkg.version
}),
resolve(),
commonjs({
include: ['node_modules/**']
}),
json(),
ts_plugin
],
output: {
file: 'compiler.js',
format: is_publish ? 'umd' : 'cjs',
name: 'svelte',
sourcemap: true,
},
external: is_publish
? []
: id => id === 'acorn' || id === 'magic-string' || id.startsWith('css-tree')
}
];

Loading…
Cancel
Save