-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
46 lines (41 loc) · 1.15 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import svelte from 'rollup-plugin-svelte';
import alias from '@rollup/plugin-alias';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import preprocess from 'svelte-preprocess';
import css from 'rollup-plugin-css-only';
import { optimizeImports as optimizeCarbonImports } from 'carbon-preprocess-svelte';
export default {
input: 'src/index.js',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'static/build/bundle.js',
},
external: ['fs', 'child_process', 'process'],
plugins: [
svelte({
preprocess: [
// Reduces build times from 12 seconds to 2
optimizeCarbonImports(),
preprocess(),
],
compilerOptions: {
dev: true,
},
}),
alias({
entries: [{ find: '@', replacement: 'src/' }],
}),
css({
output: 'bundle.css',
}),
resolve({
browser: false,
preferBuiltins: false,
dedupe: ['svelte'],
}),
commonjs(),
],
};