forked from 2juicy/destiny-child-tools
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
47 lines (44 loc) · 1.03 KB
/
webpack.config.js
File metadata and controls
47 lines (44 loc) · 1.03 KB
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 webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
// const __dirname = path.dirname(fileURLToPath(import.meta.url));
const config = {
entry: './src/index.js',
output: {
path: path.join(__dirname, 'docs'),
publicPath: '/',
filename: 'bundle.js'
},
// devServer: {
// contentBase: './docs/',
// hot: true,
// port: 9605,
// proxy: {
// '/api': {
// target: 'http://localhost:3000',
// pathRewrite: {'^/api': ''}
// }
// }
// },
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader']
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: path.join(__dirname, 'src/index.html'),
filename: 'index.html',
inject: false
}),
new webpack.DefinePlugin({
__DEV__: JSON.stringify(process.env.NODE_ENV == 'development'),
})
]
}
module.exports = config