Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@splice/angular-cli-wrapper
Advanced tools
Wraps Angular CLI in a loving stranglehold, and forces your Webpack config down its throat.
Install the package:
$ yarn add --dev @splice/angular-cli-wrapper
Initialize- this will create a default webpack-config.js
file in your project root:
$ yarn run splice-ng init
Modify any scripts in your package.json
that reference ng
(eg. ng serve
, ng build
) with splice-ng
(eg splice-ng serve
, splice-ng build
).
[TODO: This step will one day part of init
]
Angular CLI Wrapper lets you use on-disk paths in the src
attribute of img
tags (and any other attributes of other tags that you configure in webpack-config.js
). This means that references to images will be fingerprinted, and they'll respect the deployUrl
setting instead of being relative to /
.
Since the entire Webpack config is now available, you can feel free to modify it as needed for your particular application. Do be careful though- you don't want to do anything too crazy and run the risk of causing problems with Angular CLI.
Angular CLI Wrapper uses some Node Magic™ to hook into the module loading process and intercept the Angular CLI code responsible for loading Webpack configs. After the default config loading code runs, the entire configuration, along with the project's current build settings, are passed off to code in your application, providing you the opportunity to modify the Webpack config before the project is built.
The splice-ng init
command generates a default webpack-config.js
file that contains
one function, taking the existing config and build options, and returning a new config:
const merge = require('webpack-merge');
module.exports = function (originalConfig, buildOptions) {
let newConfig = merge.smart(originalConfig, {
module: {
rules: [
{ test: /\.html$/, loader: 'html-loader?-minimize&interpolate&attrs=img:src video:poster source:src' }
]
}
});
return newConfig;
}
The webpack-merge package is used which allows easy merging of Webpack configs without having to worry about unintentonally overwriting existing rules and settings.
FAQs
Splice wrapper for Angular CLI
The npm package @splice/angular-cli-wrapper receives a total of 4 weekly downloads. As such, @splice/angular-cli-wrapper popularity was classified as not popular.
We found that @splice/angular-cli-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.