Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
angular-cli-customizer
Advanced tools
A small command-line Node module that allows Angular CLI's Webpack config file to be customized
A small command-line Node module that allows Angular CLI's Webpack config file to be customized
npm install @angular/cli -g
npm install angular-cli-customizer -g
webpack.config.js
file at the root of your project containing the Webpack configuration settings you wish modify/add to the Angular CLI's build:const path = require('path');
module.exports = {
resolve: {
alias: {
// all upgraded AngularJS modules will now be forced to
// use the same version of AngularJS, removing the
// "Tried to load angular more than once." warning.
angular: path.resolve(__dirname, 'node_modules/angular')
}
}
};
cng
(think "customized" ng
) - exactly as you would with the @angular/cli
module (ng
):cng serve --open
The cng
command is simply a wrapper for the ng
command, so its API is identical to the standard ng
command!
Angular's CLI is a fantastic tool for generating and developing Angular applications. Unfortunately, it has one major flaw - at the time of writing, there is no way to customize or extend the CLI's stock functionality. Even though the Angular CLI is built on top of the infinitely configurable Webpack, the CLI doesn't allow its internal Webpack configuration to be altered.
This module does some acrobatics (modifying the require
function) to surgically replace the internal function (buildConfig()
) that is responsible for generating the CLI's Webpack configuration object. The replacement function takes the result of the original buildConfig()
call, merges in any changes defined in the custom webpack.config.js
file, and returns the merged result.
Other than that, the cng
command is simply a wrapper for the ng
command.
If you run ng eject
, the Angular CLI will create a webpack.config.js
file at the root of your project's directory that contains the configuration it uses at runtime. You can use this file as a reference when designing your own webpack.config.js
file that will augment this configuration.
Note that running ng eject
prevents the usage of some CLI features; to "uneject", delete the generated webpack.config.js
and flip the ejected
property to false
in your project's .angular.cli.json
.
Yep. It depends on internal implementation details of the CLI, which could change during any update of the @angular/cli
package. Hopefully a better customization solution will be eventually be built into the CLI.
FAQs
A small command-line Node module that allows Angular CLI's Webpack config file to be customized
The npm package angular-cli-customizer receives a total of 2 weekly downloads. As such, angular-cli-customizer popularity was classified as not popular.
We found that angular-cli-customizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.