-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
54 lines (52 loc) · 1.26 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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const entry = process.env.APP_ENV === 'testbed' ? './src/testbed/index.js' : './src/index.js';
const publicPath = process.env.NODE_ENV === 'production' ?
'/retrowave-generator/' : '/';
module.exports = {
mode: 'development',
entry: ['@babel/polyfill', entry],
output: {
filename: 'bundle.[hash].js',
path: path.resolve(__dirname, './dist'),
publicPath,
},
module: {
rules: [
{
test: /\.(woff2?|ttf|otf|eot|svg)$/,
exclude: /node_modules/,
loader: 'file-loader',
options: {
name: '[path][name].[ext]'
}
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
}
}
}
]
},
devtool: 'source-map',
plugins: [
new HtmlWebpackPlugin({
template: './template/index.ejs',
title: 'Jane 8\'s Retrowave Generator',
inject: false,
hash: true,
}),
],
devServer: {
contentBase: path.resolve('./public')
},
};