1 | const webpack = require('webpack');
|
2 | const path = require('path');
|
3 | const buildPath = path.resolve(__dirname, './web/build');
|
4 | const nodeModulesPath = path.resolve(__dirname, 'node_modules');
|
5 | const config = {
|
6 |
|
7 | entry: [
|
8 | path.join(__dirname, './web/src/app/app.jsx'),
|
9 | ],
|
10 | resolve: {
|
11 | extensions: ['', '.js', '.jsx']
|
12 | },
|
13 | watch: true,
|
14 | devtool: 'sourcemap',
|
15 | output: {
|
16 | path: path.resolve(buildPath, "app"),
|
17 | filename: 'app.js',
|
18 | },
|
19 | plugins: [
|
20 |
|
21 | new webpack.HotModuleReplacementPlugin(),
|
22 |
|
23 | new webpack.NoErrorsPlugin()
|
24 | ],
|
25 | module: {
|
26 | loaders: [{
|
27 | test: /(\.css)$/,
|
28 | loaders: ['style-loader', 'css-loader']
|
29 | },{
|
30 | test: /(\.less)$/,
|
31 | loaders: ['style-loader', 'css-loader', 'less-loader']
|
32 | },{
|
33 |
|
34 | test: /(\.jsx|\.js)$/,
|
35 | loaders: ['react-hot', 'babel-loader'],
|
36 | exclude: [nodeModulesPath],
|
37 | },{
|
38 | test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
|
39 | loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]'
|
40 | }
|
41 | ]
|
42 | },
|
43 | };
|
44 | module.exports = config;
|