Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
webpack-file-preprocessor-plugin
Advanced tools
A lightweight yet generic webpack plugin for pre-processing assets before emitting.
A lightweight yet generic webpack plugin for pre-processing assets before emitting.
# Using npm
$ npm install webpack-file-preprocessor-plugin --save-dev
# Using Yarn
$ yarn add webpack-file-preprocessor-plugin --dev
This example demonstrates how to use this plugin to minify the html assets loaded using file-loader
.
const WebpackFilePreprocessorPlugin = require('webpack-file-preprocessor-plugin');
const minifyHtml = require('html-minifier').minify;
module.exports = {
entry: {
app: './index.js'
},
output: {
path: './public/dist',
publicPath: '/dist/',
filename: '[name].bundle.js'
},
module: {
rules: [
{
test: /\.html$/,
use: {
loader: 'file-loader',
options: {
name: 'tmpl/[hash].html'
}
}
}
]
},
plugins: [
new WebpackFilePreprocessorPlugin({
// Prints processed assets if set to true (default: false)
debug: true,
// RegExp pattern to filter assets for pre-processing.
pattern: /\.html$/,
// Do your processing in this process function.
process: source => minifyHtml(source.toString())
})
]
};
Check the CHANGELOG for release history.
Licensed under MIT.
0.0.2 (2019-10-28)
Closed Issues
Changes
* This Change Log was automatically generated by github_changelog_generator
FAQs
A lightweight yet generic webpack plugin for pre-processing assets before emitting.
We found that webpack-file-preprocessor-plugin 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.