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

Changelog

Marat Dreizin edited this page Feb 8, 2017 · 15 revisions

Change Log

v7.0.0

In favour of simplicity:

  • Removed some exported instances:

    • builder

    • loader, instead of loader.loadConfig please use:

      import Config from 'webpack-config';
      
      export default = new Config().extend('./conf/webpack.development.config.js');
    • finder, please use fs module to walk through directory tree and find the appropriate path which meets your requirements

    • stringResolver

    • pathResolver

    • factory

  • Removed some exported classes:

    • ConfigBuilder
    • ConfigPatternCache
    • ConfigCache
    • ConfigLoader
    • ConfigFinder
    • ConfigStringResolver
  • Removed FILENAME static constant from Config class, please use instead:

    import { FILENAME } from 'webpack-config';

v6.0.0

  • Now constructor dependencies automatically injected by constitute.

  • Removed Config*.INSTANCE methods.

Now they can be accessible via require/import:

Before

import { ConfigEnvironment, ConfigCache } from 'webpack-config';

const environment = ConfigEnvironment.INSTANCE,
    cache = ConfigCache.INSTANCE;
const ConfigEnvironment = require('webpack-config').ConfigEnvironment,
    ConfigCache = require('webpack-config').ConfigCache;

const environment = ConfigEnvironment.INSTANCE,
    cache = ConfigCache.INSTANCE;

After

import { environment, cache } from 'webpack-config';
const environment = require('webpack-config').environment,
    cache = require('webpack-config').cache;

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