mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-19 13:05:18 +00:00
aspirational approach to differential bundling
This commit is contained in:
@@ -2,11 +2,13 @@ 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';
|
||||
import babel from 'rollup-plugin-babel';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import config from 'sapper/config/rollup.js';
|
||||
|
||||
const mode = process.env.NODE_ENV;
|
||||
const dev = mode === 'development';
|
||||
const legacy = process.env.SAPPER_LEGACY_BUILD;
|
||||
|
||||
export default {
|
||||
input: config.client.input(),
|
||||
@@ -23,6 +25,15 @@ export default {
|
||||
hydratable: true
|
||||
}),
|
||||
|
||||
legacy && babel({
|
||||
extensions: ['.js', '.html'],
|
||||
include: [
|
||||
'app/**',
|
||||
'routes/**'
|
||||
],
|
||||
runtimeHelpers: true
|
||||
}),
|
||||
|
||||
!dev && terser({
|
||||
module: true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user