Skip to content
This repository was archived by the owner on Jun 18, 2019. It is now read-only.

Changelog

Marat Dreizin edited this page Jun 29, 2016 · 15 revisions

Change Log

v5.2.0

  • Added support of webpack-config-<name> naming convention:
import Config from 'webpack-config';

// Loads from `node_modules/webpack-config-my/webpack.config.js`
export default new Config().extend('my/webpack.config.js');

Also you can use:

import Config from 'webpack-config';

// Loads from `node_modules/react-redux/webpack.config.js`
export default new Config().extend('react-redux/webpack.config.js');

v5.1.0

  • Exposed ConfigPatternCache to make posible to override ConfigPatternCache#interpolate property:
ConfigPatternCache.INSTANCE.interpolate = /{{([\s\S]+?)}}/g;
import {
    Config,
    ConfigEnvironment
} from 'webpack-config';

ConfigEnvironment.INSTANCE.setAll({
    env: () => process.env.WEBPACK_ENV || process.env.NODE_ENV
});

export default new Config().extend('./conf/webpack.{{ env }}.config.js');
  • Added some new methods Config#set, Config#remove, Config#get, Config#has.

  • Added ConfigBuilder which helps to build config based on Config or ConfigList. Also it supports hooks via ConfigBuilder#applyHooks.

v5.0.0

  • Moved some Config.* static methods to external modules. Now they can be accessible via require/import:
var Config = require('webpack-config') import { * } from 'webpack-config'
Config.Loader ~> ConfigLoader
Config.Finder ~> ConfigFinder
Config.Environment ~> ConfigEnvironment
var Config = require('webpack-config');

Config.environment.setAll({
    env: function() {
        return process.env.WEBPACK_ENV || process.env.NODE_ENV;
    }
});

modules.exports = new Config().extend('./conf/webpack.[env].config.js');
import {
    Config,
    ConfigEnvironment
} from 'webpack-config';

ConfigEnvironment.INSTANCE.setAll({
    env: () => process.env.WEBPACK_ENV || process.env.NODE_ENV
});

export default new Config().extend('./conf/webpack.[env].config.js');
  • Added dependencyTree property which holds information about all extend method calls:
import Config from 'webpack-config';

let config = new Config();

config.extend('./test/fixtures/webpack.1.config.js');

for (let {node} of config.dependencyTree) {
  console.log(node.root.filename);
}
// ./test/fixtures/webpack.1.config.js
// ./test/fixtures/webpack.2.config.js
// ./test/fixtures/webpack.3.config.js
// ./test/fixtures/webpack.5.config.js
// ./test/fixtures/webpack.4.config.js
  • Now ConfigFinder methods return full paths to configs instead of instances of Config/Config[].

  • Added ConfigCache which holds caches of Config/Config[].

Now it is easily make it non persistent via WEBPACK_CONFIG_CACHE=false environment variable or ConfigCache#persistent property:

WEBPACK_CONFIG_CACHE=false npm run build
import {
    ConfigCache
} from 'webpack-config';

ConfigCache.INSTANCE.persistent = false;
Clone this wiki locally