-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathwebpack.config.js
36 lines (33 loc) · 1000 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
import path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { URL } from 'url'; // in Browser, the URL in native accessible on window
const __dirname = new URL('.', import.meta.url).pathname;
export default {
entry: [
'./src/index.js',
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
plugins: [
new HtmlWebpackPlugin({
title: 'Factorio State Machine',
template: './src/index.html',
favicon: './src/favicon.ico'
}),
// new webpack.HotModuleReplacementPlugin(),
// new webpack.NoEmitOnErrorsPlugin(),
],
module: {
rules: [
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.ne$/, use: 'nearley-loader' },
{ test: /\.(png|jpg|ico)$/, use: 'url-loader' }
],
},
resolve: {
extensions: ['.js', '.css'],
modules: ['node_modules'],
}
};