1 | View Code Duplication | const package = require('./package.json'); |
|
0 ignored issues
–
show
Unused Code
introduced
by
![]() |
|||
2 | const webpack = require('webpack'); |
||
0 ignored issues
–
show
|
|||
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', 'stage-0'] // stage-2 = transform-object-rest-spread etc |
||
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 |