-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.prod.js
39 lines (35 loc) · 1.13 KB
/
rollup.config.prod.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 { terser } from 'rollup-plugin-terser';
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
function dateFormat() {
const currentDate = new Date();
const year = currentDate.getFullYear().toString().padStart(4, '0');
const month = (currentDate.getMonth() + 1).toString().padStart(2, '0');
const day = currentDate.getDate().toString().padStart(2, '0');
const hours = currentDate.getHours().toString().padStart(2, '0');
const minutes = currentDate.getMinutes().toString().padStart(2, '0');
return `${year}${month}${day}-${hours}${minutes}`;
}
export default {
input: "./build/main.js",
output: [
{
file: `./example/src/tools/misoh-${dateFormat()}.bundle.minify.js`,
format: "es"
},
{
file: `./dist/bundle&minify/misoh-${dateFormat()}.bundle.minify.js`,
format: "es"
}
],
plugins: [
nodeResolve(),
commonjs(),
terser({
mangle: {
properties: false,
reserved: ['misoh']
}
})
]
}