-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
60 lines (60 loc) · 1.43 KB
/
webpack.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const webpack = require('webpack');
module.exports = {
context: __dirname,
entry: {
general: './src/js/general.js',
game: './src/js/game.js',
},
output: {
path: __dirname + "/dist",
filename: '[name].js',
publicPath: '/dist/'
},
devServer: {
compress: true, port: 8080, hot: true,
},
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: { loader: 'babel-loader', options: { presets: ['env', 'es2015']}}
},
{
test: /\.(less|css)$/,
use: [ 'style-loader', 'css-loader', 'less-loader' ]
},
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader?sourceMap&camelCase&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]',
'sass-loader?sourceMap'
]
},
{
test: /\.(svg|eot|ttf|woff|woff2)$/,
loader: 'url-loader', options: { limit: 10000, name: 'fonts/[name].[ext]' }
},
{
test: /\.(png|jpg|gif)$/,
loaders: [
{
loader: 'url-loader', options: { limit: 10000, name: 'images/[name].[ext]'}
},
'img-loader'
],
},
],
},
plugins: [
new webpack.ProvidePlugin(
{
jQuery: 'jquery',
$: 'jquery',
jquery: 'jquery'
}),
new webpack.HotModuleReplacementPlugin(),
],
}