Custom webpack config #61
Answered
by
studds
olegchursin
asked this question in
Q&A
-
Is there a way to pass custom webpack config? |
Beta Was this translation helpful? Give feedback.
Answered by
studds
Feb 2, 2021
Replies: 1 comment 1 reply
-
Hey @olegchursin, yes there is, the
"build": {
"builder": "@nx-aws/sam:build",
"options": {
"outputPath": "dist/apps/api",
"template": "apps/api/template.yaml",
"tsConfig": "apps/api/tsconfig.app.json",
"assets": ["apps/api/src/assets"],
"webpackConfig": "apps/api/src/webpack.config.js",
"sourceMap": true,
"maxWorkers": 14
}
}, And then const { merge } = require('webpack-merge');
module.exports = (initialConfig) => {
return merge(initialConfig, {
// your options here
});
}; |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
olegchursin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @olegchursin, yes there is, the
webpackConfig
option (which is the same as the option available on@nrwl/node:build
:angular.json
/workspace.json
:And then
apps/api/src/webpack.config.js
is a function which takes a webpack config, and returns the enhanced / replaced webpack config: