lessen diff

pull/8504/head
Simon Holthausen 3 years ago
parent 890bcba92a
commit 1a670b6443

@ -10,7 +10,7 @@ import typescript from '@rollup/plugin-typescript';
const require = createRequire(import.meta.url); const require = createRequire(import.meta.url);
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8')); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8'));
const is_publish = !!process.env.PUBLISH; const is_publish = true;!!process.env.PUBLISH;
const ts_plugin = is_publish const ts_plugin = is_publish
? typescript({ ? typescript({
@ -40,7 +40,7 @@ export default [
input: { input: {
...runtime_entrypoints, ...runtime_entrypoints,
index: 'src/runtime/index.ts', index: 'src/runtime/index.ts',
ssr: 'src/runtime/ssr.ts', ssr: 'src/runtime/ssr.ts'
}, },
output: ['es', 'cjs'].map( output: ['es', 'cjs'].map(
/** @returns {import('rollup').OutputOptions} */ /** @returns {import('rollup').OutputOptions} */
@ -107,9 +107,9 @@ export default [
`export * from '../types/runtime/${dir}/index.js';` `export * from '../types/runtime/${dir}/index.js';`
); );
} }
}, }
}, }
], ]
}, },
/* compiler.js */ /* compiler.js */
{ {
@ -133,28 +133,28 @@ export default [
}, },
resolve(), resolve(),
commonjs({ commonjs({
include: ['node_modules/**'], include: ['node_modules/**']
}), }),
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', file: 'compiler.mjs',
format: 'esm', format: 'esm',
name: 'svelte', name: 'svelte',
sourcemap: true, sourcemap: true
}, }
], ],
external: is_publish external: is_publish
? [] ? []
: (id) => : (id) =>
id === 'acorn' || id === 'magic-string' || id.startsWith('css-tree'), id === 'acorn' || id === 'magic-string' || id.startsWith('css-tree')
}, }
]; ];

Loading…
Cancel
Save