-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathrollup.config.js
79 lines (76 loc) · 1.69 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import terser from '@rollup/plugin-terser'
import typescript from '@rollup/plugin-typescript'
import scss from 'rollup-plugin-scss'
// const terser_config = {
// ecma: 5,
// mangle: { toplevel: true },
// compress: {
// module: true,
// toplevel: true,
// unsafe_arrows: true,
// drop_console: false,
// drop_debugger: true,
// },
// output: {
// beautify: false,
// quote_style: 1,
// comments: false,
// },
// }
const terser_config = {
ecma: 5,
// mangle: false,
mangle: true,
compress: true,
output: {
beautify: false,
preserve_annotations: true,
quote_style: 1,
comments: true,
ecma: 2020,
},
}
export default [
...['example', 'sortable', 'sortable-base']
.map((s) => {
return [
{
input: `src/scss/${s}.scss`,
output: {
file: `dist/${s}.css`,
},
plugins: [
scss({
fileName: `${s}.css`,
outputStyle: 'expanded',
failOnError: true,
}),
],
},
{
input: `src/scss/${s}.scss`,
output: {
file: `dist/${s}.min.css`,
},
plugins: [
scss({
fileName: `${s}.min.css`,
outputStyle: 'compressed',
failOnError: true,
}),
],
},
]
})
.flat(),
...['sortable', 'sortable.a11y', 'sortSortable', 'sortableEventListener', 'enhanceSortableAccessibility'].map((s) => {
return {
input: `dist/esm/${s}.js`,
output: {
file: `dist/esm/${s}.min.js`,
format: 'es',
},
plugins: [terser(terser_config)],
}
}),
]