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

如何引用 raw-loader #1567

Closed
tolerance-go opened this issue Dec 3, 2018 · 3 comments
Closed

如何引用 raw-loader #1567

tolerance-go opened this issue Dec 3, 2018 · 3 comments

Comments

@tolerance-go
Copy link

tolerance-go commented Dec 3, 2018

想在项目里动态引用 markdown,直接 require 得到的是 base64的 makdown text;使用 内联方式指定 raw-loader 得到还是 base64 的数据,请问在哪里关闭转换 base64 功能

@sorrycc
Copy link
Member

sorrycc commented Dec 3, 2018

用 chainWebpack 配 .md 文件的 loader。

@tolerance-go
Copy link
Author

export default config => {
  // config.when(process.env.NODE_ENV === 'production', $config => {
  //   $config.plugin('BundleAnalyzerPlugin').use(BundleAnalyzerPlugin);
  // });
  config.module
    .rule('md')
    .test(/\.md$/)
    .include.add('src')
    .end()
    .use('raw')
    .loader('raw-loader');
};

不起作用,还是被转成base64了,如何修改limit选项呢

@sorrycc
Copy link
Member

sorrycc commented Dec 7, 2018

参考 #1421 (comment)

@sorrycc sorrycc closed this as completed Dec 7, 2018
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

No branches or pull requests

2 participants