UNPKG

1.28 kBJavaScriptView Raw
1const babel = require('rollup-plugin-babel')
2const nodeResolve = require('rollup-plugin-node-resolve')
3const commonjs = require('rollup-plugin-commonjs')
4const replace = require('rollup-plugin-replace')
5const paths = require('./path')
6const eslint = require('rollup-plugin-eslint')
7
8const date = new Date()
9const dateString = `${date.getFullYear()}${date.getMonth()+1}${date.getDate()}${date.getHours()}${date.getMinutes()}${date.getSeconds()}`
10
11module.exports = {
12 entry: paths.appEntry,
13 dest: 'dist',
14 onwarn: function(warning) {
15 // Skip certain warnings
16
17 // should intercept ... but doesn't in some rollup versions
18 if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
19
20 // console.warn everything else
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