-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.dev.js
78 lines (77 loc) · 1.91 KB
/
webpack.config.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
var path = require('path');
const entryPath = path.join(__dirname, 'src'),
outputPath = path.join(__dirname, 'dist');
const webpack = require('webpack');
module.exports = {
devtool: "source-map",
entry: {
main: './src/index.js'
},
watchOptions: {
poll: true
},
devServer: {
contentBase: outputPath,
hot: true,
compress: true,
port: 3000,
publicPath: '/js/'
},
output: {
path: path.resolve(__dirname, 'dist/js'),
filename: '[name].js',
publicPath: "/js/"
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: [/node_modules/],
use: ['babel-loader'],
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: [
'file-loader'
]
}
]
},
resolve: {
// Leaflet image Alias resolutions
alias: {
'./images/layers.png$': path.resolve(__dirname, './node_modules/leaflet/dist/images/layers.png'),
'./images/layers-2x.png$': path.resolve(__dirname, './node_modules/leaflet/dist/images/layers-2x.png'),
'./images/marker-icon.png$': path.resolve(__dirname, './node_modules/leaflet/dist/images/marker-icon.png'),
'./images/marker-icon-2x.png$': path.resolve(__dirname, './node_modules/leaflet/dist/images/marker-icon-2x.png'),
'./images/marker-shadow.png$': path.resolve(__dirname, './node_modules/leaflet/dist/images/marker-shadow.png')
}
},
plugins: [
new webpack.HotModuleReplacementPlugin(), // Enable HMR
new webpack.NamedModulesPlugin(),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
jquery: 'jquery',
'window.$': 'jquery',
'window.jQuery': 'jquery',
})
],
node: {
fs: 'empty',
}
};