WIP
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import resolve from '@rollup/plugin-node-resolve'
|
||||
import replace from '@rollup/plugin-replace'
|
||||
import commonjs from '@rollup/plugin-commonjs'
|
||||
import svelte from 'rollup-plugin-svelte-hot'
|
||||
// import svelte from 'rollup-plugin-svelte'
|
||||
// import svelte from 'rollup-plugin-svelte-hot'
|
||||
import svelte from 'rollup-plugin-svelte'
|
||||
import babel from 'rollup-plugin-babel'
|
||||
// import { eslint } from 'rollup-plugin-eslint'
|
||||
// import browsersync from 'rollup-plugin-browsersync'
|
||||
import hmr from 'rollup-plugin-hot'
|
||||
// import hmr from 'rollup-plugin-hot'
|
||||
import sveltePreprocess from 'svelte-preprocess'
|
||||
import { terser } from 'rollup-plugin-terser'
|
||||
import config from 'sapper/config/rollup.js'
|
||||
@@ -36,30 +36,26 @@ export default {
|
||||
input: config.client.input(),
|
||||
output: {
|
||||
...config.client.output(),
|
||||
...dev && { exports: 'named' }
|
||||
// ...dev && { exports: 'named' }
|
||||
},
|
||||
experimentalCodeSplitting: true,
|
||||
// experimentalCodeSplitting: true,
|
||||
plugins: [
|
||||
// Javascript
|
||||
svelte({
|
||||
dev,
|
||||
preprocess,
|
||||
hydratable: true,
|
||||
emitCss: !hot,
|
||||
// emitCss: true,
|
||||
// css: css => css.write('public/bundle.css'),
|
||||
...(!hot && {
|
||||
css: css => {
|
||||
css.write('public/bundle.css')
|
||||
},
|
||||
}),
|
||||
hot: hot && {
|
||||
// sapper-dev-client expects either webpack or rollup with no HMR, so
|
||||
// we need to prevent it from doing full reloads with rollup
|
||||
patchSapperDevClient: true,
|
||||
// optimistic will try to recover from runtime errors during
|
||||
// component init (instead of doing a full reload)
|
||||
optimistic: true,
|
||||
}
|
||||
css: css => css.write('static/bundle.css', dev),
|
||||
// hot: hot && {
|
||||
// // sapper-dev-client expects either webpack or rollup with no HMR, so
|
||||
// // we need to prevent it from doing full reloads with rollup
|
||||
// patchSapperDevClient: true,
|
||||
// // optimistic will try to recover from runtime errors during
|
||||
// // component init (instead of doing a full reload)
|
||||
// optimistic: true,
|
||||
// }
|
||||
}),
|
||||
replace({
|
||||
'process.browser': true,
|
||||
@@ -72,15 +68,15 @@ export default {
|
||||
}),
|
||||
commonjs(),
|
||||
// dev && eslint(),
|
||||
legacy && !hot && babel({
|
||||
!dev && babel({
|
||||
extensions: ['.js', '.mjs', '.html', '.svelte'],
|
||||
exclude: ['node_modules/@babel/**'],
|
||||
runtimeHelpers: true
|
||||
}),
|
||||
hot && hmr({
|
||||
public: '__sapper__/dev',
|
||||
inMemory: true,
|
||||
}),
|
||||
// hot && hmr({
|
||||
// public: '__sapper__/dev',
|
||||
// inMemory: true,
|
||||
// }),
|
||||
|
||||
// Compress Javascript
|
||||
!dev && terser({
|
||||
|
||||
Reference in New Issue
Block a user