-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
executable file
·47 lines (45 loc) · 1 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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ROOT_PATH = path.resolve(__dirname);
const APP_PATH = path.resolve(ROOT_PATH, 'app');
module.exports = {
// target: 'web',
// devtool: 'source-map',
entry: {
app: ['./app/js/index.js'],
},
output: {
path: path.resolve(ROOT_PATH, 'dist'),
filename: 'bundle.js',
publicPath: '/assets/',
},
module: {
rules: [
{
test: /\.js$/,
include: [
path.resolve(APP_PATH, 'js'),
],
loader: 'babel-loader',
query: {
compact: true,
},
},
{
test: /\.css$/,
loader: 'style-loader!css-loader',
},
{
test: /\.(png|jpe?g|gif|eot|svg|ttf|woff|woff2|otf)/i,
loader: 'file?name=assets/[name].[hash].[ext]',
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(APP_PATH, 'index.html'),
filename: 'index.html',
inject: false,
}),
],
};