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

支持配置url-loader的exclude #80

Closed
iwege opened this issue Jan 31, 2018 · 2 comments
Closed

支持配置url-loader的exclude #80

iwege opened this issue Jan 31, 2018 · 2 comments

Comments

@iwege
Copy link

iwege commented Jan 31, 2018

Environment(required) | 环境(必填)

任意环境

What did you do? Please provide steps to re-produce your problem.(请提供复现步骤)

  1. webpack.config.js里面配置
webpackConfig.module.rules.push({
    test: /\.ya?ml$/,
    use: [ 'yml-loader']
  })
  1. 在index.js里面
import yml from './test.yaml'
console.log(yml)

得到的是base64的信息。

What do you expected?(预期的正常效果)

正常解析为JSON

What happen?(发生了何种非正常现象)

得到的是base64的信息。和url-loader 的exclude配置有关系

Workaround

webpack.config.js 里面添加

webpackConfig.module.rules.forEach((item) => {
    if (!item.test && item.exclude) {
      item.exclude.push(/\.ya?ml$/)
    }
  })
@iwege
Copy link
Author

iwege commented Feb 6, 2018

@sorrycc
Copy link
Member

sorrycc commented Mar 14, 2018

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

No branches or pull requests

2 participants