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

docs: provide an example of adding a custom file loader configuration #12180

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Jinbao1001
Copy link
Member

@Jinbao1001 Jinbao1001 commented Mar 7, 2024

provide an example of adding a custom file loader configuration in chainwebpack

Copy link

vercel bot commented Mar 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
umi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 11, 2024 7:49am

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.47%. Comparing base (0694d3a) to head (ad90906).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12180      +/-   ##
==========================================
- Coverage   28.48%   28.47%   -0.01%     
==========================================
  Files         492      492              
  Lines       15119    15123       +4     
  Branches     3601     3605       +4     
==========================================
  Hits         4306     4306              
- Misses      10041    10047       +6     
+ Partials      772      770       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.type('javascript/auto') // 添加此行配置
.use('abc-loader')
.loader('abc-loader')
.end();
Copy link
Member

@fz6m fz6m Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样并不好,因为你的文件并不一定就是 js 相关的,可能是一些自定义格式或者 wasm 或 css 等相关的,直接在 asset 规则里排除你要处理的文件正则就行了,参考:wasm 配置 方法。

建议把这里的说明和示例改成配置自定义 loader + 去掉 asset 里的命中的形式。

Jinbao1001 and others added 2 commits March 11, 2024 15:43
Co-authored-by: Peach <scdzwyxst@gmail.com>
Co-authored-by: Peach <scdzwyxst@gmail.com>
@fz6m
Copy link
Member

fz6m commented Mar 23, 2024

关于自定义 loader ,可以参考下 #12222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants