1 | const package = require('./package.json'); |
||
2 | const path = require('path'); |
||
3 | |||
4 | const config = { |
||
5 | mode: 'production', |
||
6 | entry: './main.prod.js', |
||
7 | output: { |
||
8 | path: path.normalize(__dirname + '/build'), |
||
0 ignored issues
–
show
Compatibility
introduced
by
![]() |
|||
9 | publicPath: '', |
||
10 | filename: 'index.js', |
||
11 | library: '[name]', |
||
12 | chunkFilename: '[name].[chunkhash].js', |
||
13 | libraryTarget: 'umd', |
||
14 | umdNamedDefine: true |
||
15 | }, |
||
16 | devServer: { |
||
17 | inline: true, |
||
18 | port: 8888 |
||
19 | }, |
||
20 | module: { |
||
21 | rules: [ |
||
22 | { |
||
23 | test: /\.jsx?$/, |
||
24 | exclude: /node_modules/, |
||
25 | loader: 'babel-loader', |
||
26 | query: { |
||
27 | presets: ['es2015', 'react', 'stage-0'] // stage-2 = transform-object-rest-spread etc |
||
28 | } |
||
29 | }, |
||
30 | { |
||
31 | test: /\.css$/, |
||
32 | loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]' |
||
33 | }, |
||
34 | {test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'} |
||
35 | ] |
||
36 | }, |
||
37 | plugins: [] |
||
38 | .concat(require('./helpers/plugins/injectVars')({ |
||
39 | bundleName: package.name, |
||
40 | bundleVersion: package.version, |
||
41 | bundleDescription: package.description, |
||
42 | bundleAuthor: package.author, |
||
43 | isPlatform: false, |
||
44 | })), |
||
45 | externals: { |
||
46 | 'react': 'umd react', |
||
47 | 'react-dom': 'umd react-dom', |
||
48 | 'prop-types': 'umd prop-types', |
||
49 | 'classnames': 'umd classnames', |
||
50 | 'css-loader': 'umd css-loader', |
||
51 | 'file-loader': 'umd file-loader', |
||
52 | 'style-loader': 'umd style-loader', |
||
53 | 'url-loader': 'umd url-loader', |
||
54 | 'resolve-url': 'umd resolve-url', |
||
55 | 'expect': 'umd expect', |
||
56 | 'react-rte': 'umd react-rte', |
||
57 | 'lodash': 'umd lodash', |
||
58 | 'hoek': 'umd hoek', |
||
59 | 'superagent': 'umd superagent', |
||
60 | 'react-minimal-pie-chart': 'umd react-minimal-pie-chart', |
||
61 | 'react-trend': 'umd react-trend' |
||
62 | } |
||
63 | }; |
||
64 | module.exports = config; |
||
65 |