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

feat: 如何配置支持 css inline 引入 #1971

Closed
rowthan opened this issue Nov 27, 2023 · 3 comments
Closed

feat: 如何配置支持 css inline 引入 #1971

rowthan opened this issue Nov 27, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@rowthan
Copy link

rowthan commented Nov 27, 2023

What problem does this feature solve?

如何配置可以支持 css inline 引入?
import css from './style.scss?inline'

Possible Solution (optional)

尝试通过修改 webpack ,但无效。

    config.module
      .rule('scss')
      .test(/\.scss$/)
      .oneOf('normal')
      .use('style-loader')
      .loader('style-loader')
      .end()
      .use('css-loader')
      .loader('css-loader')
      .end()
      .use('sass-loader')
      .loader('sass-loader')
      .end()
      .end()
      .oneOf('inline')
      .resourceQuery(/inline/)
      .use('raw-loader')
      .loader('raw-loader')
      .end()
      .use('sass-loader')
      .loader('sass-loader')
      .end();
  },```
@rowthan rowthan added the enhancement New feature or request label Nov 27, 2023
@PeachScript
Copy link
Member

应该是命中 dumi 内置的 loader 了,你要对已经存在的 scss rule 做修改,或者参考 Webpack 文档中 loader inline 的用法

另外 issue 仅接受 bug 和 feature request,使用咨询请使用 disussion

@PeachScript PeachScript closed this as not planned Won't fix, can't repro, duplicate, stale Nov 29, 2023
@mengxinssfd
Copy link

@rowthan 遇到了同一个问题,能说下你最后是如何处理的吗

@mengxinssfd
Copy link

找到了,import css from '!!raw-loader!sass-loader!postcss-loader!./index.scss' 有用!

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

No branches or pull requests

3 participants