mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-22 06:15:18 +00:00
use Rollup
This commit is contained in:
27
rollup/service-worker.config.js
Normal file
27
rollup/service-worker.config.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
import replace from 'rollup-plugin-replace';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import config from 'sapper/config/rollup.js';
|
||||
|
||||
const mode = process.env.NODE_ENV;
|
||||
const dev = mode === 'development';
|
||||
|
||||
export default {
|
||||
input: config.serviceworker.input(),
|
||||
output: config.serviceworker.output(),
|
||||
plugins: [
|
||||
resolve(),
|
||||
replace({
|
||||
'process.browser': true,
|
||||
'process.env.NODE_ENV': JSON.stringify(mode)
|
||||
}),
|
||||
commonjs(),
|
||||
!dev && terser()
|
||||
],
|
||||
|
||||
// temporary, pending https://github.com/rollup/rollup/pull/2432
|
||||
watch: {
|
||||
chokidar: { disableGlobbing: true }
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user