Skip to content

Commit

Permalink
feat(appconfig): Add base path so module preloading works
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Oct 12, 2023
1 parent 7af5c2a commit 3057128
Show file tree
Hide file tree
Showing 3 changed files with 395 additions and 10 deletions.
12 changes: 11 additions & 1 deletion lib/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,18 @@ export const createAppConfig = (entries: { [entryAlias: string]: string }, optio
// Extended config for apps
const overrides: UserConfig = {
plugins,
// we need to set the base path, so module preloading works correctly
// currently this is hidden behind the `experimental` options.
experimental: {
renderBuiltUrl(filename) {
return {
// already contains the "js/" prefix as it is our output file configuration
runtime: `OC.filePath('${appName}', '', '${filename}')`,
}
},

Check warning on line 113 in lib/appConfig.ts

View check run for this annotation

Codecov / codecov/patch

lib/appConfig.ts#L109-L113

Added lines #L109 - L113 were not covered by tests
},
build: {
/* Output dir is the project root to allow main style to be generated within `/css` */
// Output dir is the project root to allow main style to be generated within `/css`
outDir: '',
emptyOutDir: false, // ensure project root is NOT emptied!
rollupOptions: {
Expand Down
Loading

0 comments on commit 3057128

Please sign in to comment.