This repository was archived by the owner on Jun 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Changelog
Marat Dreizin edited this page Jun 29, 2016
·
15 revisions
- 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');- Exposed
ConfigPatternCacheto make posible to overrideConfigPatternCache#interpolateproperty:
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
ConfigBuilderwhich helps to build config based onConfigorConfigList. Also it supports hooks viaConfigBuilder#applyHooks.
- Moved some
Config.*static methods to external modules. Now they can be accessible viarequire/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
dependencyTreeproperty which holds information about allextendmethod 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
ConfigFindermethods return full paths to configs instead of instances ofConfig/Config[]. -
Added
ConfigCachewhich holds caches ofConfig/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;