-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrollup.config.js
39 lines (36 loc) · 1.1 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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import { chromeExtension, simpleReloader } from 'rollup-plugin-chrome-extension';
import svelte from 'rollup-plugin-svelte';
import autoPreprocess from 'svelte-preprocess';
import postcss from 'rollup-plugin-postcss';
import copy from 'rollup-plugin-copy';
import { terser } from 'rollup-plugin-terser';
const isProduction = process.env.NODE_ENV === 'production';
export default [
{
input: 'src/manifest.json',
output: {
dir: 'dist',
format: 'esm',
},
plugins: [
// always put chromeExtension() before other plugins
chromeExtension(),
// Adds a Chrome extension reloader during watch mode
simpleReloader(),
svelte({
preprocess: autoPreprocess(),
}),
postcss({
minimize: isProduction,
}),
resolve(),
commonjs(),
typescript(),
copy({ targets: [{ src: 'src/assets/iconfont.woff2', dest: 'dist/assets' }] }),
isProduction && terser(),
],
},
];