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