Webpack environment config plugin
Lightweight and zero-dependecies plugin for webpack that allows you to create file on deploy by environment configuration.
How to install?
Easy.
npm install webpack-environment-config-plugin --save-dev
Then, add to your(s) webpack config file like webpack.config.js
(or similar, by environment).
// ...requiresconst EnvironmentConfigurationFiles = ; const filename = 'config.json';const envConfig = JSON; module { return // ... // your webpack config here output: path: 'dist/' // REQUIRED plugins: // ... // other plugins filename envConfig };
API
constructor: void
- @params
- filename
- data (environment config)
- options object
- encoding [string|null] (default: UTF-8)
- mode [integer] *(default: 0o666)
apply void
- @params
- compiler