【发布时间】:2019-05-15 16:29:27
【问题描述】:
我想在 laravel-mix 构建期间或之后删除临时构建文件。
这是我目前拥有的一些代码,但 del 不起作用:
const mix = require('laravel-mix');
const del = require('del');
// compile sass into temp css file
mix.sass('resources/stylesheets/style.scss', 'public/css/temp.css');
// compile css
mix.styles([
// other css stylesheets here...
'public/css/temp.css' // include temp css file
], 'public/css/admin.min.css');
// delete temp css file
del('public/css/temp.css'); // not deleting the file
【问题讨论】:
-
你为什么要这样做?为什么不直接创建 admin.min.css?
-
@KuebelElch15 你不能在
mix.sass()中混合css和sass文件所以这是我的解决方法。 -
哦,我看错了
//other css stylesheets评论
标签: javascript webpack laravel-mix del