-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.dev.config.js
37 lines (36 loc) · 1.11 KB
/
webpack.dev.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const webpack = require('webpack'),
path = require('path'),
HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
app: './src/index.js'
},
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/',
filename: '[name].js'
},
module: {
rules: [
{ test: /\.js$/, include: path.join(__dirname, 'src'), use: [ 'babel-loader' ] },
{ test: /\.json$/, use: [ 'json-loader' ] },
{ test: /\.css$/, use: [ 'style-loader', 'css-loader' ] },
{ test: /\.less$/, use: [ 'style-loader', 'css-loader', 'less-loader' ] },
{ test: /\.(png|jpg)$/, use: [ 'url-loader?limit=8192' ] }
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({ template: 'views/index.html.ejs' })
],
externals: {
Config: JSON.stringify(require('./src/config/config.json'))
},
devServer: {
port: 3000,
hot: true,
inline: true,
historyApiFallback: true
},
devtool: 'cheap-module-eval-source-map'
};