Skip to content

Commit

Permalink
fix build order
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed May 27, 2019
1 parent 7777bf0 commit c70deee
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down Expand Up @@ -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')
}
];

0 comments on commit c70deee

Please sign in to comment.