gpt4 book ai didi

parceljs - 包裹打包机 : import scss files from node_modules without specifying the full path?

转载 作者:行者123 更新时间:2023-12-04 15:18:15 30 4
gpt4 key购买 nike

目前,我像这样导入 scss 文件:

@import './node_modules/bulma/bulma';

但是,在 Laravel Mix 中,我了解到我可以像这样导入文件,而无需指定 ./node_modules :
@import '~bulma/bulma';

无论如何,我可以在 ParcelJS 中做到这一点吗?

最佳答案

webpack 中的 sass-loader 使用 node-sass 的自定义导入器功能将所有查询传递给 webpack 解析引擎。

但是在包裹打包机中,

尚未为 SASS/SCSS 实现 node_modules 解析算法。目前,您可以创建一个 .sassrc 或 .sassrc.js 文件来配置 node-sass includePaths 选项以包含 node_modules。

找到当前的解决方法 in this discussion

关于parceljs - 包裹打包机 : import scss files from node_modules without specifying the full path?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48001173/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com