ts-config-webpack-plugin

2.0.3 • Public • Published

ts-config-webpack-plugin

NPM version Build Status lerna License Commitizen friendly Prettier

Creating a webpack loader configurations can be quite time consuming.
The ts-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. The injected configurations are based on ts-loader thread-loader example.
⚙️development mode webpack.config.js ⚙️production mode webpack.config.js

Installation

npm i --save-dev ts-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 TsConfigWebpackPlugin = require('ts-config-webpack-plugin');
module.exports = {
  plugins: [new TsConfigWebpackPlugin()],
};

tsconfig.json

By default the ts-config-webpack-plugin uses the tsconfig plugin to locate the tsconfig file.
To change the default location an option called configFile can be passed to the ts-config-webpack-plugin.
If no configuration can be determined the src/config/tsconfig.base.json file will be used as fallback.

const TsConfigWebpackPlugin = require('ts-config-webpack-plugin');
module.exports = {
  plugins: [
    new TsConfigWebpackPlugin({
      configFile: '/foo/bar/tsconfig.json',
    }),
  ],
};

Package Sidebar

Install

npm i ts-config-webpack-plugin

Weekly Downloads

817

Version

2.0.3

License

MIT

Unpacked Size

35.7 kB

Total Files

17

Last publish

Collaborators

  • namicsorg
  • ernscht
  • jantimon
  • ddegiorgioo