single-spa-angular
Advanced tools
Comparing version 9.0.0 to 9.0.1-alpha
@@ -11,3 +11,3 @@ "use strict"; | ||
exports.default = (config, options, extraOptions) => { | ||
var _a, _b, _c, _d; | ||
var _a, _b, _c, _d, _e; | ||
const libraryName = getLibraryName(config, options); | ||
@@ -62,2 +62,32 @@ extraOptions = Object.assign(Object.assign({}, defaultExtraOptions), extraOptions); | ||
} | ||
else { | ||
// The `entry` doesn't have a `styles` property, which means we're on the Angular | ||
// 15+ version where `StylesWebpackPlugin` was introduced to resolve module resolution | ||
// issues related to Yarn PNP. | ||
const stylesWebpackPluginName = 'StylesWebpackPlugin'; | ||
const stylesWebpackPlugin = mergedConfig.plugins.find((plugin) => plugin.constructor.name === stylesWebpackPluginName); | ||
const entryPoints = (_e = stylesWebpackPlugin === null || stylesWebpackPlugin === void 0 ? void 0 : stylesWebpackPlugin.options) === null || _e === void 0 ? void 0 : _e.entryPoints; | ||
if (entryPoints) { | ||
// The `ngGlobalStyle` is a Webpack query required by Angular to | ||
// apply a specific list of Webpack loaders to these files. There | ||
// are only two queries available: `ngGlobalStyle` and `ngResource` | ||
// (used for component styles). | ||
// Webpack would then do the following: | ||
// `{ use: globalStyleLoaders, resourceQuery: /\?ngGlobalStyle/ }` | ||
const query = `?ngGlobalStyle`; | ||
Object.keys(entryPoints).forEach(entryPoint => { | ||
// `styles` is the primary styles that must be loaded with the main entry point. | ||
if (entryPoint === 'styles') { | ||
const styles = entryPoints.styles.map(path => `${path}${query}`); | ||
mergedConfig.entry.main = [...styles, ...mergedConfig.entry.main]; | ||
} | ||
else { | ||
// Other entry points (which are lazy bundles) must be a part of entries to resolve | ||
// to separate JS files. | ||
mergedConfig.entry[entryPoint] = entryPoints[entryPoint].map(path => `${path}${query}`); | ||
} | ||
}); | ||
removePluginByName(mergedConfig.plugins, stylesWebpackPluginName); | ||
} | ||
} | ||
// Remove bundles | ||
@@ -64,0 +94,0 @@ // Since Angular 8 supports differential loading it also |
{ | ||
"$schema": "../node_modules/ng-packagr/ng-package.schema.json", | ||
"name": "single-spa-angular", | ||
"version": "9.0.0", | ||
"version": "9.0.1-alpha", | ||
"description": "Helpers for building single-spa applications which use Angular 2", | ||
@@ -6,0 +6,0 @@ "schematics": "./schematics/schematics.json", |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
196541
1914
2
1