Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-config-webpack-plugin

Package Overview
Dependencies
Maintainers
4
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-config-webpack-plugin

Preset for javascript webpack configuration

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

js-config-webpack-plugin

NPM version Build Status lerna License Commitizen friendly Prettier

Creating a webpack loader configurations can be quite time consuming.
The js-config-webpack-plugin is part of the common-config-webpack-plugin suite which tries to provide best practices for the most common loader requirements.

If no mode is explicitly set for the plugin the configuration will adjust depending on your webpack mode setting.

⚙️development mode webpack.config.js ⚙️production mode webpack.config.js

Installation

npm i --save-dev js-config-webpack-plugin

Webpack Config

In most projects you will need to set up project specific options but you can still use all or some common-config-webpack-plugin parts.

const JsConfigWebpackPlugin = require('js-config-webpack-plugin');
module.exports = {
  plugins: [new JsConfigWebpackPlugin()],
};

.babelrc

By default the js-config-webpack-plugin has defined a base .babelrc file which contains options for the babel compiler. If babel should use a specific .babelrc file, it's possible to pass the option babelConfigFile with the filepath to the correct .babelrc file.

  • babelConfigFile: Default undefined, a .babelrc file relative to the context is searched. If no option file is found the base file .babelrc.base.json will be taken. When option contains a filepath, the configurations from the specified file will be used.
const JsConfigWebpackPlugin = require('js-config-webpack-plugin');
module.exports = {
  plugins: [
    new JsConfigWebpackPlugin({
      babelConfigFile: '/foo/bar/.babelrc',
    }),
  ],
};

Keywords

FAQs

Package last updated on 20 May 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc