Last active
August 3, 2021 16:14
-
-
Save mr-vaibh/4d59310e5179689f2c4b206d3f19d7fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
const webpack = require("webpack"); | |
module.exports = { | |
entry: "./src/index.js", | |
output: { | |
path: path.resolve(__dirname, "./dist"), | |
filename: "[name].bundle.js", | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
use: { | |
loader: "babel-loader", | |
}, | |
}, | |
{ | |
test: /\.css$/i, | |
use: ["style-loader", "css-loader"] | |
}, | |
{ | |
test: /\.(png|jpg|gif)$/, | |
use: [ | |
{ | |
loader: "file-loader", | |
options: { | |
publicPath: '/dist', | |
useRelativePaths: true | |
} | |
} | |
] | |
} | |
], | |
}, | |
optimization: { | |
minimize: true, | |
}, | |
plugins: [ | |
new webpack.DefinePlugin({ | |
"process.env": { | |
// This has effect on the react lib size | |
NODE_ENV: JSON.stringify("development"), | |
}, | |
}), | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment