Skip to content

Commit

Permalink
adding webpack and babel.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jaiminmoslake7020 committed Nov 26, 2024
1 parent c2efde1 commit e256477
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"license": "",
"author": "",
"scripts": {
"build": "rm -rf build && npx webpack --mode production",
"build:dev": "rm -rf build && npx webpack --mode development",
"build": "rm -rf build && npx webpack --mode production --env=production",
"build:dev": "rm -rf build && npx webpack --mode development --env=development",
"dev": "webpack serve --mode development --stats-error-details"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')

module.exports = {
entry: [
module.exports = env => ({
entry: env.production ? './app/index.ts' : [
'webpack-dev-server/client?http://localhost:3000', // Required for HMR
'webpack/hot/dev-server', // Required for HMR
'./app/index.ts',
Expand Down Expand Up @@ -59,4 +59,4 @@ module.exports = {
],
}),
]
}
});

0 comments on commit e256477

Please sign in to comment.