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(app): Build in app mode and not in lib mode while building Nextcloud apps #31

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
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
Loading