Skip to content

Commit

Permalink
feat: handle svg as normal image assets in bundle mode (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Mar 16, 2023
1 parent c38c56f commit 428b8d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/builder/bundle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ async function bundless(opts: IBundlessOpts): Promise<void | IBundleWatcher> {
});
}

// also bundle svg as asset, because father force disable svgr
const imgRule = memo.module.rule('asset').oneOf('image');

imgRule.test(
new RegExp(imgRule.get('test').source.replace(/(\|png)/, '$1|svg')),
);

// disable progress bar
memo.plugins.delete('progress-plugin');

Expand Down

0 comments on commit 428b8d7

Please sign in to comment.