weboptimizer 4.0.10 → 4.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weboptimizer",
3
- "version": "4.0.10",
3
+ "version": "4.0.11",
4
4
  "description": "A generic web optimizer, (module) bundler and development environment.",
5
5
  "keywords": [
6
6
  "webpack",
@@ -78,12 +78,13 @@ Logger.configureAllInstances({
78
78
  const module = configuration.module;
79
79
  // region initialization
80
80
  /// region determine library name
81
+ const exportFormatsNeedingAValidVariableName = ['assign', 'global', 'this', 'var', 'window'];
81
82
  let libraryName;
82
83
  if (configuration.libraryName) libraryName = configuration.libraryName;else if (Object.keys(configuration.injection.entry.normalized).length > 1) libraryName = '[name]';else {
83
84
  libraryName = configuration.name;
84
- if (['assign', 'global', 'this', 'var', 'window'].includes(configuration.exportFormat.self)) libraryName = convertToValidVariableName(libraryName);
85
+ if (exportFormatsNeedingAValidVariableName.includes(configuration.exportFormat.self)) libraryName = convertToValidVariableName(libraryName);
85
86
  }
86
- if (libraryName === '*') libraryName = ['assign', 'global', 'this', 'var', 'window'].includes(configuration.exportFormat.self) ? Object.keys(configuration.injection.entry.normalized).map(name => convertToValidVariableName(name)) : undefined;
87
+ if (libraryName === '*') libraryName = exportFormatsNeedingAValidVariableName.includes(configuration.exportFormat.self) ? Object.keys(configuration.injection.entry.normalized).map(name => convertToValidVariableName(name)) : undefined;
87
88
  /// endregion
88
89
  /// region plugins
89
90
  const pluginInstances = [];
@@ -704,7 +705,7 @@ if (configuration.files.compose.cascadingStyleSheet && plugins.MiniCSSExtract) {
704
705
  So we inject live reload and hot module replacement manually.
705
706
  */
706
707
  if (htmlAvailable && configuration.debug && configuration.development.server.liveReload && !Object.prototype.hasOwnProperty.call(configuration.injection.entry.normalized, 'developmentHandler') && (configuration.development.includeClient || typeof configuration.development.includeClient !== 'boolean' && ['serve', 'test:browser'].includes(configuration.givenCommandLineArguments[2]))) {
707
- configuration.injection.entry.normalized.developmentHandler = ['webpack-dev-server/client/index.js?' + 'live-reload=true' + `&hot=${configuration.development.server.hot ? 'true' : 'false'}` + `&http${configuration.development.server.https ? 's' : ''}://` + `${configuration.development.server.host}: ` + String(configuration.development.server.port)];
708
+ configuration.injection.entry.normalized.developmentHandler = ['webpack-dev-server/client/index.js?' + 'live-reload=true' + `&hot=${configuration.development.server.hot ? 'true' : 'false'}` + `&http${configuration.development.server.https ? 's' : ''}://` + `${configuration.development.server.host}:` + String(configuration.development.server.port)];
708
709
  if (configuration.development.server.hot) {
709
710
  configuration.injection.entry.normalized.developmentHandler.push('webpack/hot/dev-server.js');
710
711
  configuration.development.server.hot = false;