-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
32 lines (30 loc) · 1022 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
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");
module.exports = {
cache: false,
entry: './src/index.js',
module: {
rules: [
{ test: /\.(css|scss|sass)$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
{ test: /\.(js|jsx)$/, use: 'babel-loader' },
{ test: /\.(svg)$/, loader: 'file-loader', options: { name: 'public/[name].[ext]' } },
{
test: /\.(png|jpg|jpeg|svg|gif)$/,
type: 'asset/resource',
}
]
},
output: {
path: path.resolve(__dirname, 'build'),
filename: 'index_bundle.js',
publicPath: '/'
//publicPath: 'https://suriones.github.io/AnimazeHub/'
},
devServer: {
historyApiFallback: true
},
plugins: [
new HtmlWebpackPlugin({ template: "./src/index.html", favicon: "./public/logo.png" })
],
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development'
}