-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
58 lines (53 loc) · 1.27 KB
/
rollup.config.js
File metadata and controls
58 lines (53 loc) · 1.27 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
55
56
57
58
/* global __dirname, process */
import path from 'path';
import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import { uglify } from 'rollup-plugin-uglify';
import inlineSvg from 'rollup-plugin-inline-svg';
import replace from '@rollup/plugin-replace';
import json from '@rollup/plugin-json';
import alias from '@rollup/plugin-alias';
const production = !process.env.ROLLUP_WATCH;
const uglifyPrepared = () =>
uglify({
output: {
comments: /@preserve|@license|@cc_on|License|Copyright/,
},
});
const projectRootDir = path.resolve(__dirname);
export default [
{
input: 'src/kata3/index.js',
output: {
file: './output.js',
name: 'output',
format: 'es',
},
plugins: [
alias({
entries: [
{
find: 'src',
replacement: path.resolve(projectRootDir, 'src'),
},
],
}),
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
json({
exclude: 'node_modules/**',
}),
inlineSvg({
removeSVGTagAttrs: false,
}),
nodeResolve({
browser: true,
preferBuiltins: true,
}),
commonjs({
include: /node_modules/,
}),
],
},
];