diff --git a/rollup.config.js b/rollup.config.js index 61798c2512..8907ae4e6c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -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') + } ];