-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
54 lines (47 loc) · 1.36 KB
/
Copy pathrollup.config.js
File metadata and controls
54 lines (47 loc) · 1.36 KB
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
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import sass from 'rollup-plugin-sass';
import html from 'rollup-plugin-html';
import { terser } from 'rollup-plugin-terser';
import filesize from 'rollup-plugin-filesize';
const production = !process.env.ROLLUP_WATCH;
function onwarn(warning) {
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
console.error(`(!) ${warning.message}`);
}
}
export default {
input: 'src/index.js',
onwarn,
output: [
{
sourcemap: false,
format: 'iife',
name: 'UnoCodeAPP',
file: 'build/unocode.js'
}
],
plugins: [
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration —
// consult the documentation for details:
// https://github.com/rollup/rollup-plugin-commonjs
resolve(),
commonjs(),
html({
include: '**/*.html'
}),
sass(),
// If we're building for production (npm run build
// instead of npm run dev), transpile and minify
production && babel({
exclude: 'node_modules/**',
babelrc: false,
presets: [['@babel/env', { useBuiltIns: 'usage', modules: false }]],
}),
production && terser(),
production && filesize(),
]
};