Total Complexity | 0 |
Complexity/F | 0 |
Lines of Code | 47 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | const path = require('path'); |
||
2 | const webpack = require('webpack'); |
||
3 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); |
||
4 | |||
5 | module.exports = { |
||
6 | entry: [ |
||
7 | 'webpack-dev-server/client?/', |
||
8 | 'webpack/hot/dev-server', |
||
9 | './src/index.jsx' |
||
10 | ], |
||
11 | resolve: { |
||
12 | extensions: ['.js', '.jsx', '.css', '.scss'] |
||
13 | }, |
||
14 | devServer: { |
||
15 | historyApiFallback: true |
||
16 | }, |
||
17 | output: { |
||
18 | path: path.resolve(__dirname, './dist'), |
||
19 | filename: 'bundle.js', |
||
20 | }, |
||
21 | module: { |
||
22 | loaders: [ |
||
23 | { |
||
24 | test: /\.js|\.jsx?$/, |
||
25 | use: ['babel-loader?presets[]=react,presets[]=es2015,plugins[]=transform-decorators-legacy'], |
||
26 | exclude: [path.resolve(__dirname, 'node_modules/')] |
||
27 | }, |
||
28 | { |
||
29 | test: /\.scss|\.less$/, |
||
30 | use: ExtractTextPlugin.extract({ |
||
31 | fallback: 'style-loader', |
||
32 | use: 'css-loader!sass-loader!less-loader', |
||
33 | }), |
||
34 | }, |
||
35 | ] |
||
36 | }, |
||
37 | target: 'web', |
||
38 | plugins: [ |
||
39 | new ExtractTextPlugin('css/bundle.style.css'), |
||
40 | new webpack.HotModuleReplacementPlugin(), |
||
41 | new webpack.DefinePlugin({ |
||
42 | 'process.env': { |
||
43 | NODE_ENV: JSON.stringify('development') |
||
44 | } |
||
45 | }) |
||
46 | ] |
||
47 | }; |
||
48 |