Skip to content

Commit

Permalink
feat: build library new option - emitAssets
Browse files Browse the repository at this point in the history
  • Loading branch information
torsteinringnes committed Sep 22, 2021
1 parent 2fb2561 commit d463bd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/vite/src/node/build.ts
Expand Up @@ -212,6 +212,7 @@ export interface LibraryOptions {
name?: string
formats?: LibraryFormats[]
fileName?: string | ((format: ModuleFormat) => string)
emitAssets?: boolean
}

export type LibraryFormats = 'es' | 'cjs' | 'umd' | 'iife'
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/asset.ts
Expand Up @@ -287,7 +287,7 @@ async function fileToBuiltUrl(

let url: string
if (
config.build.lib ||
(config.build.lib && !config.build.lib.emitAssets) ||
(!file.endsWith('.svg') &&
content.length < Number(config.build.assetsInlineLimit))
) {
Expand Down

0 comments on commit d463bd9

Please sign in to comment.