Skip to content

Commit

Permalink
Merge pull request #31 from nextcloud-libraries/fix/app-config-not-in…
Browse files Browse the repository at this point in the history
…-lib-mode

fix(app): Build in app mode and not in lib mode while building Nextcloud apps
  • Loading branch information
susnux authored Oct 2, 2023
2 parents e933117 + 4aca7d2 commit f3194a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
8 changes: 3 additions & 5 deletions lib/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,13 @@ export const createAppConfig = (entries: { [entryAlias: string]: string }, optio
const overrides: UserConfig = {
plugins,
build: {
lib: {
entry: {
...entries,
},
},
/* 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: {
input: {
...entries,
},
output: {
// global variables for appName and appVersion
intro: `const appName = ${JSON.stringify(appName)}; const appVersion = ${JSON.stringify(appVersion)};`,
Expand Down
4 changes: 0 additions & 4 deletions lib/baseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,6 @@ export function createBaseConfig(options: BaseOptions = {}): UserConfigFn {
},
build: {
cssTarget: browserslistToEsbuild(),
lib: {
formats: ['es'],
entry: {},
},
sourcemap: isDev || 'hidden',
target: browserslistToEsbuild(),
},
Expand Down
1 change: 1 addition & 0 deletions lib/libConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export const createLibConfig = (entries: { [entryAlias: string]: string }, optio
entry: {
...entries,
},
formats: options.libraryFormats,
},
// workaround, see above
minify: options.minify ?? env.mode === 'production' ? 'esbuild' : false,
Expand Down

0 comments on commit f3194a0

Please sign in to comment.