-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
49 lines (47 loc) · 1.01 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
47
48
49
import path from 'node:path'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import alias from '@rollup/plugin-alias'
import json from '@rollup/plugin-json'
import terser from '@rollup/plugin-terser'
import postcss from 'rollup-plugin-postcss'
import atImport from 'postcss-import'
import cssnano from 'cssnano'
const production = !process.env.ROLLUP_WATCH
export default {
input: 'app/static/src/js/main.js',
output: {
file: 'app/static/dist/bundle.js',
format: 'iife',
// sourcemap: !production || 'inline'
},
watch: {
include: [
'app/static/src/js/**/*.js',
'app/static/src/css/**/*.css'
]
},
plugins: [
postcss({
extract: 'styles.css',
plugins: [
atImport(),
production && cssnano({
preset: ['default', {
colormin: false,
convertValues: false
}]
})
]
}),
// alias({
// entries: {
// htmx: 'htmx.org/dist/htmx.js'
// }
// }),
resolve(),
commonjs(),
// json(),
production && terser()
]
};