-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.dev.js
53 lines (49 loc) · 1.17 KB
/
webpack.dev.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
var rules = require("./rules");
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: [
'whatwg-fetch',
'./src/index'
],
output: {
filename: 'build.js',
path: path.resolve(__dirname, 'dist'),
publicPath: './'
},
resolve: {
modules: [
'node_modules',
path.resolve(__dirname, 'src')
],
extensions: ['.ts', '.tsx', '.js', '.sass', '.scss', '.html']
},
devtool: "source-map",
plugins: [
//new BundleAnalyzerPlugin({
// analyzerMode: 'static'
//}),
new HtmlWebpackPlugin({
template: './index.html',
inject: 'body'
//hash: true
}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
'window.jquery': 'jquery'
}),
new CleanWebpackPlugin(['dist'], {
root: __dirname,
verbose: true,
dry: false
})
],
module: {
rules: rules
}
};