ngc-webpack
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "ngc-webpack", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "A wrapper for the angular compiler-cli with webpack integration", | ||
@@ -5,0 +5,0 @@ "author": "Shlomi Assaf <shlomiasaf@gmail.com>", |
@@ -5,2 +5,21 @@ "use strict"; | ||
var plugin_1 = require('./plugin'); | ||
/** | ||
* Resolve the config to an object. | ||
* If it's a fn, invoke. | ||
* | ||
* Also check if it's a mocked ES6 Module in cases where TS file is used that uses "export default" | ||
* @param config | ||
* @returns {any} | ||
*/ | ||
function resolveConfig(config) { | ||
if (typeof config === 'function') { | ||
return config(); | ||
} | ||
else if (config.__esModule === true && !!config.default) { | ||
return resolveConfig(config.default); | ||
} | ||
else { | ||
return config; | ||
} | ||
} | ||
var WebpackWrapper = (function () { | ||
@@ -13,3 +32,3 @@ function WebpackWrapper(webpackConfigPath) { | ||
var config = require(this.webpackConfigPath); | ||
this.config = typeof config === 'function' ? config() : config; | ||
this.config = resolveConfig(config); | ||
} | ||
@@ -16,0 +35,0 @@ catch (err) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39174
298