Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] generateLibraryPreload: Ignore missing modules #481

Merged
merged 5 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions lib/tasks/bundlers/generateLibraryPreload.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ const log = require("@ui5/logger").getLogger("builder:tasks:bundlers:generateLib
const moduleBundler = require("../../processors/bundlers/moduleBundler");
const ReaderCollectionPrioritized = require("@ui5/fs").ReaderCollectionPrioritized;

function getDefaultLibraryPreloadFilters(namespace) {
return [
`${namespace}/`,
`!${namespace}/.library`,
`!${namespace}/designtime/`,
`!${namespace}/**/*.designtime.js`,
`!${namespace}/**/*.support.js`,
`!${namespace}/themes/`,
`!${namespace}/messagebundle*`
];
}

function getBundleDefinition(namespace) {
// TODO: move to config of actual core project
if (namespace === "sap/ui/core") {
Expand All @@ -21,15 +33,9 @@ function getBundleDefinition(namespace) {
{
mode: "preload",
filters: [
`${namespace}/`,
`!${namespace}/.library`,
`!${namespace}/designtime/`,
`!${namespace}/**/*.designtime.js`,
`!${namespace}/**/*.support.js`,
`!${namespace}/themes/`,
`!${namespace}/cldr/`,
`!${namespace}/messagebundle*`,
...getDefaultLibraryPreloadFilters(namespace),

`!${namespace}/cldr/`,
"*.js",
"sap/base/",
"sap/ui/base/",
Expand Down Expand Up @@ -69,15 +75,7 @@ function getBundleDefinition(namespace) {
sections: [
{
mode: "preload",
filters: [
`${namespace}/`,
`!${namespace}/.library`,
`!${namespace}/designtime/`,
`!${namespace}/**/*.designtime.js`,
`!${namespace}/**/*.support.js`,
`!${namespace}/themes/`,
`!${namespace}/messagebundle*`
],
filters: getDefaultLibraryPreloadFilters(namespace),
resolve: false,
resolveConditional: false,
renderer: true
Expand Down Expand Up @@ -106,8 +104,7 @@ function getModuleBundlerOptions(config) {
optimize: config.preload,
decorateBootstrapModule: config.preload,
addTryCatchRestartWrapper: config.preload,
usePredefineCalls: config.preload,
ignoreMissingModules: true
usePredefineCalls: config.preload
};

moduleBundlerOptions.bundleDefinition = getSapUiCoreBunDef(config.name, config.filters, config.preload);
Expand Down Expand Up @@ -255,7 +252,8 @@ module.exports = function({workspace, dependencies, options}) {
bundleDefinition: getBundleDefinition(libraryNamespace),
bundleOptions: {
optimize: true,
usePredefineCalls: true
usePredefineCalls: true,
ignoreMissingModules: true
}
},
resources
Expand Down
Loading