@@ 1-52 (lines=52) @@ | ||
1 | const package = require('./package.json'); |
|
2 | const webpack = require('webpack'); |
|
3 | const path = require('path'); |
|
4 | ||
5 | const config = { |
|
6 | entry: './main.prod.js', |
|
7 | output: { |
|
8 | path: path.normalize(__dirname + '/build'), |
|
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 | loaders: [ |
|
22 | { |
|
23 | test: /\.jsx?$/, |
|
24 | exclude: /node_modules/, |
|
25 | loader: 'babel-loader', |
|
26 | query: { |
|
27 | presets: ['es2015', 'react'] |
|
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 | .concat(require('./helpers/plugins/css')) |
|
46 | .concat(require('./helpers/plugins/uglify')) |
|
47 | .concat(require('./helpers/plugins/html')), |
|
48 | externals: { |
|
49 | 'react/addons': true |
|
50 | } |
|
51 | } |
|
52 | module.exports = config; |
|
53 |
@@ 1-39 (lines=39) @@ | ||
1 | const package = require('./package.json'); |
|
2 | const webpack = require('webpack'); |
|
3 | const path = require('path'); |
|
4 | ||
5 | const config = { |
|
6 | entry: './main.js', |
|
7 | output: { |
|
8 | path: path.normalize(__dirname + '/build'), |
|
9 | publicPath: '', |
|
10 | filename: 'index.js', |
|
11 | library: '[name]', |
|
12 | chunkFilename: '[name].[chunkhash].js' |
|
13 | }, |
|
14 | devServer: { |
|
15 | inline: true, |
|
16 | port: 8888 |
|
17 | }, |
|
18 | module: { |
|
19 | loaders: [ |
|
20 | { |
|
21 | test: /\.jsx?$/, |
|
22 | exclude: /node_modules/, |
|
23 | loader: 'babel-loader', |
|
24 | query: { |
|
25 | presets: ['es2015', 'react'] |
|
26 | } |
|
27 | }, |
|
28 | { |
|
29 | test: /\.css$/, |
|
30 | loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]' |
|
31 | }, |
|
32 | {test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'} |
|
33 | ] |
|
34 | }, |
|
35 | externals: { |
|
36 | 'react/addons': true |
|
37 | } |
|
38 | } |
|
39 | module.exports = config; |
|
40 |