Skip to content

Commit

Permalink
feat: update webpack config
Browse files Browse the repository at this point in the history
- update loaders
- fix externals handling
- update target
- fix log levels depending on mode
  • Loading branch information
abelflopes committed Jan 24, 2024
1 parent 54cefe3 commit 8b957c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions packages/infra/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"@types/webpack-node-externals": "^3.0.4"
},
"dependencies": {
"css-loader": "^6.8.1",
"sass": "^1.69.5",
"sass-loader": "^13.3.2",
"style-loader": "^3.3.3",
"ts-loader": "^9.5.0",
"css-loader": "^6.9.1",
"sass": "^1.70.0",
"sass-loader": "^14.0.0",
"style-loader": "^3.3.4",
"ts-loader": "^9.5.1",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-node-externals": "^3.0.0"
Expand Down
11 changes: 6 additions & 5 deletions packages/infra/webpack/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export const getWebpackConfig = (options?: WebpackConfigOptions): Configuration
outputModule: true,
},
optimization: {
minimize: false,
minimize: mode === "production",
},
target: "es2020",
target: "web",
module: {
rules: [
{
Expand Down Expand Up @@ -88,11 +88,12 @@ export const getWebpackConfig = (options?: WebpackConfigOptions): Configuration
},
externals: [
nodeExternals({
importType: "module",
additionalModuleDirs: [mainNodeModulesFolder],
}),
],
externalsType: "module",
stats: mode === "production" ? "normal" : "summary",
externalsPresets: {
web: true,
},
stats: mode === "development" ? "normal" : "summary",
};
};

0 comments on commit 8b957c0

Please sign in to comment.