1 | const babel = require('rollup-plugin-babel')
|
2 | const nodeResolve = require('rollup-plugin-node-resolve')
|
3 | const commonjs = require('rollup-plugin-commonjs')
|
4 | const replace = require('rollup-plugin-replace')
|
5 | const paths = require('./path')
|
6 | const eslint = require('rollup-plugin-eslint')
|
7 |
|
8 | const date = new Date()
|
9 | const dateString = `${date.getFullYear()}${date.getMonth()+1}${date.getDate()}${date.getHours()}${date.getMinutes()}${date.getSeconds()}`
|
10 |
|
11 | module.exports = {
|
12 | entry: paths.appEntry,
|
13 | dest: 'dist',
|
14 | onwarn: function(warning) {
|
15 |
|
16 |
|
17 |
|
18 | if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
|
19 |
|
20 |
|
21 | console.warn( warning.message );
|
22 | },
|
23 | plugins: [
|
24 | eslint({
|
25 | configFile: paths.ownEslintConfig,
|
26 | useEslintrc: false,
|
27 | include: ['src/**'],
|
28 | exclude: ['node_modules/**', 'dist/**']
|
29 | }),
|
30 | babel({
|
31 | exclude: 'node_modules/**'
|
32 | }),
|
33 | nodeResolve({
|
34 | module: false,
|
35 | main: true
|
36 | }),
|
37 | commonjs({
|
38 | include: 'node_modules/**'
|
39 | }),
|
40 | replace({
|
41 | 'process.env.NODE_ENV': JSON.stringify( 'production' ),
|
42 | 'process.env.BUILD_VERSION': JSON.stringify(process.env.BUILD_VERSION)
|
43 | })
|
44 | ]
|
45 | } |
\ | No newline at end of file |