Osk*_*oos 5 stylus webpack laravel-mix
我有一个大型 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/, ./node_modules/,../../../../node_modules等前缀;似乎没有任何作用。这一切都导致:
failed to locate @require file node_modules/jeet/styl/index.styl
Run Code Online (Sandbox Code Playgroud)
通过../../../../node_modules和../../../node_modules,我得到以下结果;
Module build failed: Error: EISDIR: illegal operation on a directory, read
at Error (native)
Run Code Online (Sandbox Code Playgroud)
我怎样才能让 Stylus 在 node_modules (我的首选解决方案)中找到这些依赖项,或者在 Laravel Mix 选项中复制上述内容?
| 归档时间: |
|
| 查看次数: |
927 次 |
| 最近记录: |