Skip to content

Commit

Permalink
feat: ✨ add long list of empty loader
Browse files Browse the repository at this point in the history
  • Loading branch information
stormslowly committed Jun 3, 2024
1 parent c5efc64 commit 09d5d61
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions packages/preset-umi/src/features/prepare/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ export async function build(opts: {
loader: {
// use tsx loader for js/jsx/ts/tsx files
// since only ts support decorator
...possibleExtUsingEmptyLoader,
'.js': 'tsx',
'.jsx': 'tsx',
'.ts': 'ts',
'.tsx': 'tsx',
'.less': 'empty',
'.scss': 'empty',
'.sass': 'empty',
},
// do I need this?
// incremental: true,
Expand Down Expand Up @@ -80,3 +78,34 @@ export async function build(opts: {
return [result, undefined];
}
}

const possibleExtUsingEmptyLoader = {
'.aac': 'empty',
'.css': 'empty',
'.less': 'empty',
'.sass': 'empty',
'.scss': 'empty',
'.eot': 'empty',
'.flac': 'empty',
'.gif': 'empty',
'.htm': 'empty',
'.html': 'empty',
'.ico': 'empty',
'.icon': 'empty',
'.jpeg': 'empty',
'.jpg': 'empty',
'.empty': 'empty',
'.mdx': 'empty',
'.mp3': 'empty',
'.mp4': 'empty',
'.ogg': 'empty',
'.otf': 'empty',
'.png': 'empty',
'.svg': 'empty',
'.ttf': 'empty',
'.wav': 'empty',
'.webm': 'empty',
'.webp': 'empty',
'.woff': 'empty',
'.woff2': 'empty',
} as const;

0 comments on commit 09d5d61

Please sign in to comment.