To relocate the node_modules directory from within the Angular project, you can follow these steps:
Here is an example of what your "build" configuration should look like:
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "../node_modules/my-project"
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
}
In this example, the nodemodules directory will be relocated to the ../nodemodules/my-project directory, which is one level above the root directory of the Angular project. You can replace this path with any directory path that you prefer.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-12-02 11:00:00 +0000
Seen: 17 times
Last updated: Mar 27 '23
How can I insert a Cookie in the Nginx Configuration File?
What could be the reason for the node app not functioning on Namecheap hosting?
In what way can I transition from Traefik 2.4.2 to the latest version 2.9.x?
I encountered an error while attempting to install ingress-nginix using the YAML manifest.
What is the process for deploying Nuxt with nginx?