-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
rollup.config.js
45 lines (43 loc) · 1.04 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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import cssbundle from 'rollup-plugin-css-bundle';
import copy from 'rollup-plugin-copy';
import { terser } from 'rollup-plugin-terser';
import postcss from 'postcss';
import postcssImport from 'postcss-import';
const isProduction = !process.env.ROLLUP_WATCH;
export default {
input: 'js/main.js',
output: {
file: 'public/bundle.js',
name: 'WoIstMarkt',
format: 'iife',
sourcemap: !isProduction
},
plugins: [
resolve(),
commonjs(),
json(),
isProduction && terser({
mangle: {
module: true,
}
}),
cssbundle({
transform: code => postcss([postcssImport]).process(code, {
from: "css/main.css"
})
}),
copy({
targets: [{
src: 'node_modules/leaflet.awesome-markers/dist/images/**/*',
dest: 'public/images/'
},
{
src: 'font/**/*.{woff,woff2,ttf}',
dest: 'public'
}]
})
]
};