-
Notifications
You must be signed in to change notification settings - Fork 24
/
webpack.config.js
41 lines (38 loc) · 994 Bytes
/
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
var path = require("path");
var webpack = require("webpack");
var app_dir = __dirname + '/client';
var HtmlWebpackPlugin = require('html-webpack-plugin');
var HTMLWebpackPluginConfig = new HtmlWebpackPlugin({
template: app_dir + '/index.html',
filename: 'index.html',
inject: 'body'
});
var config = {
entry: app_dir + '/app.js',
output: {
path: __dirname + '/dist',
filename: 'app.js'
},
module: {
rules: [{
test: /\.s?css$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
}, {
test: /\.js$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components)/,
options: { babelrcRoots: ['.', '../'] }
}]
},
plugins: [HTMLWebpackPluginConfig,
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
})
]
};
module.exports = config;