【问题标题】:It's problem with handling with sass in nextjs在 nextjs 中处理 sass 有问题
【发布时间】:2019-11-12 19:10:57
【问题描述】:

编译失败:

./node_modules/bootstrap/scss/bootstrap.scss 8:0
Module parse failed: Unexpected character '@' (8:0)
You may need an appropriate loader to handle this file type.
|  */
| 
> @import "functions";
| @import "variables";
| @import "mixins";

【问题讨论】:

    标签: reactjs sass next.js scss-mixins


    【解决方案1】:

    使用下一个 scss 插件

    点击此链接至next-sass

    接下来你可以看到如何处理 sass 的完整细分。

    你需要像这样添加一个配置文件

    next.config.js

    const withSass = require('@zeit/next-sass')
    module.exports = withSass({})
    

    然后重新启动您的开发进程。 Sass 现在应该可以工作并被转译了。

    【讨论】:

    • 这个答案对我不起作用,我会遇到同样的错误
    猜你喜欢
    • 1970-01-01
    • 2016-12-03
    • 1970-01-01
    • 2021-10-10
    • 2021-03-11
    • 2017-06-11
    • 2020-01-12
    • 2014-01-12
    • 2011-04-07
    相关资源
    最近更新 更多