update rollup config to fix breaking change in css.write
fix #58 fix https://github.com/rrweb-io/rrweb/issues/496
This commit is contained in:
@@ -12,12 +12,24 @@ const production = !process.env.ROLLUP_WATCH;
|
||||
|
||||
const entries = (production
|
||||
? [
|
||||
{ file: pkg.module, format: 'es' },
|
||||
{ file: pkg.main, format: 'cjs' },
|
||||
{ file: pkg.unpkg, format: 'iife', name: 'rrwebPlayer' },
|
||||
{ file: pkg.module, format: 'es', css: false },
|
||||
{ file: pkg.main, format: 'cjs', css: false },
|
||||
{
|
||||
file: pkg.unpkg,
|
||||
format: 'iife',
|
||||
name: 'rrwebPlayer',
|
||||
css: 'style.css',
|
||||
},
|
||||
]
|
||||
: []
|
||||
).concat([{ file: 'public/bundle.js', format: 'iife', name: 'rrwebPlayer' }]);
|
||||
).concat([
|
||||
{
|
||||
file: 'public/bundle.js',
|
||||
format: 'iife',
|
||||
name: 'rrwebPlayer',
|
||||
css: 'bundle.css',
|
||||
},
|
||||
]);
|
||||
|
||||
export default entries.map((output) => ({
|
||||
input: 'src/main.ts',
|
||||
@@ -28,10 +40,7 @@ export default entries.map((output) => ({
|
||||
dev: !production,
|
||||
// we'll extract any component CSS out into
|
||||
// a separate file — better for performance
|
||||
css: (css) => {
|
||||
css.write('dist/style.css');
|
||||
css.write('public/bundle.css');
|
||||
},
|
||||
css: output.css && ((css) => css.write(output.css)),
|
||||
preprocess: sveltePreprocess({
|
||||
postcss: {
|
||||
// eslint-disable-next-line no-undef
|
||||
|
||||
@@ -1186,10 +1186,10 @@ rollup-plugin-livereload@^1.0.0:
|
||||
dependencies:
|
||||
livereload "^0.9.1"
|
||||
|
||||
rollup-plugin-svelte@^5.0.3:
|
||||
version "5.2.3"
|
||||
resolved "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-5.2.3.tgz#efdc15e3e3fdd9b9f1100fdc14a8532b4e587bc8"
|
||||
integrity sha512-513vOht9A93OV7fvmpIq8mD1JFgTZ5LidmpULKM2Od9P1l8oI5KwvO32fwCnASuVJS1EkRfvCnS7vKQ8DF4srg==
|
||||
rollup-plugin-svelte@^6.1.1:
|
||||
version "6.1.1"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-svelte/-/rollup-plugin-svelte-6.1.1.tgz#66362cf0500fb7a848283ebcf19d289a60ef0871"
|
||||
integrity sha512-ijnm0pH1ScrY4uxwaNXBpNVejVzpL2769hIEbAlnqNUWZrffLspu5/k9/l/Wsj3NrEHLQ6wCKGagVJonyfN7ow==
|
||||
dependencies:
|
||||
require-relative "^0.8.7"
|
||||
rollup-pluginutils "^2.8.2"
|
||||
|
||||
Reference in New Issue
Block a user