Skip to content

Commit

Permalink
fix(lib): Libraries do not need to be minified by default as this is …
Browse files Browse the repository at this point in the history
…done on app level

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Apr 21, 2024
1 parent e31aa42 commit ba24236
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/libConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ import { ImportCSSPlugin } from './plugins/ImportCSS.js'
type OutputOptions = BuildOptions['rollupOptions']['output']

export interface LibraryOptions extends BaseOptions {
/**
* Whether to minify the output
* @default false For libraries the code is not minified by default for better debugging of applications
*/
minifiy?: boolean

/**
* Options for the rollup node externals plugin
*
Expand Down Expand Up @@ -52,7 +58,13 @@ export interface LibraryOptions extends BaseOptions {
*/
export const createLibConfig = (entries: { [entryAlias: string]: string }, options: LibraryOptions = {}): UserConfigFn => {
// Add default values for options
options = { config: {}, nodeExternalsOptions: {}, libraryFormats: ['es'], ...options }
options = {
config: {},
minifiy: false,
nodeExternalsOptions: {},
libraryFormats: ['es'],
...options,
}

const node = nodeExternals({
builtins: true, // Mark all node core modules, like `path` as external
Expand Down

0 comments on commit ba24236

Please sign in to comment.