【问题标题】:sass-loader on webpack in Asp.Net CoreAsp.Net Core 中 webpack 上的 sass-loader
【发布时间】:2019-02-02 06:12:41
【问题描述】:

我需要帮助来连接样式加载器 scss-loader

我尝试在 webpack.config.js 中包含 sass-loader

vue 组件:

@import '@/styles/mixin.scss';

webpack.config.js:

....
    {
    test: /\.scss$/,
    exclude: /(node_modules)/,
    use: [
      'style-loader',
      'css-loader',
      'sass-loader'
    ]
  },
....

但总是有错误

Error: Module build failed (from ./node_modules/sass-loader/lib/loader.js):
undefined
^
  File to import not found or unreadable: src/styles/mixin.scss.

有什么办法可以治愈吗?

【问题讨论】:

  • this 有帮助吗?
  • 这是我的失败,@import "src/styles/mixin.scss" 不正确

标签: javascript asp.net webpack sass


【解决方案1】:

在 vue 组件导入模块中有路径 'src/name.scss' 更改它并且加载器工作

【讨论】:

    猜你喜欢
    • 2016-05-20
    • 2019-02-24
    • 2020-08-12
    • 2017-07-15
    • 2018-02-22
    • 2018-07-26
    • 2021-04-18
    • 2017-11-18
    相关资源
    最近更新 更多