Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
common-config-webpack-plugin
Advanced tools
Creating webpack loader configurations can be quite time consuming.
This project tries to provide best practices for the most common loader requirements: ts
, js
, css
, fonts
and images
.
Instead of copying loader configs from github and stackoverflow you could just add one of the following plugins.
Webpack itself provides many defaults so you are able to run the common-config-webpack-plugin
without a webpack.config file:
npm i --save-dev webpack webpack-cli common-config-webpack-plugin
npx webpack --plugin common-config-webpack-plugin
You can even setup an entire development server without configuration:
npm i --save-dev webpack common-config-webpack-plugin html-webpack-plugin
webpack-dev-server --plugin common-config-webpack-plugin --plugin html-webpack-plugin
Many projects will need some project specific options. The common-config-webpack-plugin
suite is designed to be pluggable so you will be able to pick only what you need and combine it with your configuration. By default the plugin configuration will adjust depending on your webpack mode setting.
common-config-webpack-plugin
├── js-config-webpack-plugin
├── ts-config-webpack-plugin
├── scss-config-webpack-plugin
└── asset-config-webpack-plugin
├── font-config-webpack-plugin
└── image-config-webpack-plugin
To get started you can just add all common-config-webpack-plugin
parts at once.
const CommonConfigWebpackPlugin = require('common-config-webpack-plugin');
module.exports = {
plugins: [new CommonConfigWebpackPlugin()],
};
Which would be exactly the same as
const JsConfigWebpackPlugin = require('js-config-webpack-plugin');
const TsConfigWebpackPlugin = require('ts-config-webpack-plugin');
const ScssConfigWebpackPlugin = require('scss-config-webpack-plugin');
const FontConfigWebpackPlugin = require('font-config-webpack-plugin');
const ImageConfigWebpackPlugin = require('image-config-webpack-plugin');
module.exports = {
plugins: [
new JsConfigWebpackPlugin(),
new TsConfigWebpackPlugin(),
new ScssConfigWebpackPlugin(),
new FontConfigWebpackPlugin(),
new ImageConfigWebpackPlugin(),
],
};
🗒️js-config-webpack-plugin
Readme
⚙️development webpack.config.js
⚙️production webpack.config.js
The js-config-webpack-plugin
is a modified version of the create-react-app best practices.
By default the plugin configuration will adjust depending on your webpack mode setting.
const JsConfigWebpackPlugin = require('js-config-webpack-plugin');
module.exports = {
plugins: [new JsConfigWebpackPlugin()],
};
🗒️ts-config-webpack-plugin
Readme
⚙️development webpack.config.js
⚙️production webpack.config.js
The ts-config-webpack-plugin
is a modified version of the ts-loader best practices.
By default the plugin configuration will adjust depending on your webpack mode setting.
const TsConfigWebpackPlugin = require('ts-config-webpack-plugin');
module.exports = {
plugins: [new TsConfigWebpackPlugin()],
};
🗒️scss-config-webpack-plugin
Readme
⚙️development webpack.config.js
⚙️production webpack.config.js
The scss-config-webpack-plugin
is a modified version of the create-react-app best practices.
By default the plugin configuration will adjust depending on your webpack mode setting.
const ScssConfigWebpackPlugin = require('scss-config-webpack-plugin');
module.exports = {
plugins: [new ScssConfigWebpackPlugin()],
};
🗒️asset-config-webpack-plugin
Readme
The asset-config-webpack-plugin
is just a wrapper around the font-config-webpack-plugin
and the image-config-webpack-plugin
.
const AssetConfigWebpackPlugin = require('asset-config-webpack-plugin');
module.exports = {
plugins: [new AssetConfigWebpackPlugin()],
};
🗒️font-config-webpack-plugin
Readme
⚙️development webpack.config.js
⚙️production webpack.config.js
The font-config-webpack-plugin
will allow you to use woff-fonts.
const FontConfigWebpackPlugin = require('font-config-webpack-plugin');
module.exports = {
plugins: [new FontConfigWebpackPlugin()],
};
🗒️image-config-webpack-plugin
Readme
⚙️development webpack.config.js
⚙️production webpack.config.js
The image-config-webpack-plugin
will allow you to use images from within js and css files.
const ImageConfigWebpackPlugin = require('image-config-webpack-plugin');
module.exports = {
plugins: [new ImageConfigWebpackPlugin()],
};
The common-config-webpack-plugin
suite provides typechecks and integration tests for the loader configurations for Windows and Unix.
The common-config-webpack-plugin
has direct dependencies to babel and ts.
However if you need to pick a specific version you can use the js-config-webpack-plugin
or ts-config-webpack-plugin
which use peer-dependencies instead.
The common-config-webpack-plugin
is MIT licensed.
2.0.3 (2021-05-20)
Note: Version bump only for package webpack-config-plugins
FAQs
A suite of common webpack loader configurations
The npm package common-config-webpack-plugin receives a total of 8 weekly downloads. As such, common-config-webpack-plugin popularity was classified as not popular.
We found that common-config-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.