-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.config.js
More file actions
35 lines (33 loc) · 1.07 KB
/
webpack.dev.config.js
File metadata and controls
35 lines (33 loc) · 1.07 KB
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
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const APP_DIR = path.resolve(__dirname, 'client');
const DIST_DIR = path.resolve(__dirname, 'dist');
module.exports = {
context: APP_DIR,
entry: [
'webpack-hot-middleware/client?reload=true',
'./app.js'
],
output: {
publicPath: '/',
path: DIST_DIR,
filename: 'bundle.js'
},
devtool: 'inline-source-map',
module: {
rules: [
{ test: /\.html$/, loader: 'html-loader' },
{ test: /\.js$/, exclude: /(node_modules|bower_components)/, use: ['ng-annotate-loader', 'babel-loader'] },
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.(jpe?g|gif|png|svg|woff|ttf|wav|mp3)$/, use: "file-loader" }
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'index.html')
})
]
};