add postLoaders

This commit is contained in:
Joe Fleming 2015-08-24 16:23:43 -07:00
parent 3018f82cf2
commit c78ce05a8e
3 changed files with 12 additions and 0 deletions

View file

@ -145,6 +145,7 @@
"gruntify-eslint": "^1.0.0",
"html-entities": "^1.1.1",
"husky": "^0.8.1",
"istanbul-instrumenter-loader": "^0.1.3",
"karma": "^0.13.3",
"karma-chrome-launcher": "^0.2.0",
"karma-firefox-launcher": "^0.1.6",

View file

@ -125,6 +125,7 @@ class BaseOptimizer {
}, babelOptions)
}
].concat(this.env.loaders),
postLoaders: this.env.postLoaders || [],
noParse: this.env.noParse,
},

View file

@ -54,6 +54,7 @@ module.exports = class UiBundlerEnv {
// webpack loaders map loader configuration to regexps
this.loaders = [];
this.postLoaders = [];
}
consumePlugin(plugin) {
@ -74,6 +75,11 @@ module.exports = class UiBundlerEnv {
for (let loader of arr(spec)) this.addLoader(loader);
};
case 'postLoaders':
return (plugin, spec) => {
for (let loader of arr(spec)) this.addPostLoader(loader);
};
case 'noParse':
return (plugin, spec) => {
for (let re of arr(spec)) this.addNoParse(re);
@ -94,6 +100,10 @@ module.exports = class UiBundlerEnv {
this.loaders.push(loader);
}
addPostLoader(loader) {
this.postLoaders.push(loader);
}
addNoParse(regExp) {
this.noParse.push(regExp);
}