Passed
Pull Request — master (#28)
by Inumidun
01:30
created

example/webpack.config.js   A

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 47
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 0
wmc 0
c 1
b 0
f 1
nc 1
mnd 0
bc 0
fnc 0
dl 0
loc 47
rs 10
bpm 0
cpm 0
noi 0
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