我有一个大型 Stylus 项目,需要从 vanilla Gulp 移植到 Laravel Mix 中。
其中app.styl包括另一个来自node_modules 的framework.styl内容@import。我无法在 Laravel Mix 中使用use和import标志(或者至少我不知道如何使用),因为
@import "includes/framework.styl"
/* Other stuff */
Run Code Online (Sandbox Code Playgroud)
$variable = 1.5
$other = white
/* bunch more */
@import "jeet"
@import "foo/src/specific.styl"
ks-no-conflict = true
@import "kouto-swiss"
/* other stuff */
Run Code Online (Sandbox Code Playgroud)
@import中的所有s 都framework.styl来自node_modules。这些依赖项和文件的加载顺序很重要,因为如果加载顺序错误,它们可能会相互冲突。
但是,当我运行时npm run dev,它抱怨无法在 中找到任何依赖项位置framework.styl。
我尝试@import在路径前加上~/, node_modules/ …