我正在将多站点 Laravel 应用从 Mix 迁移到 Vite。使用 Mix,我根据目录名称重命名资产。使用 Vite 可以吗?
我的混合代码:
const { readdirSync, statSync } = require("fs");
const { join } = require("path");
const dirs = (p) =>
readdirSync(p).filter(
(f) => statSync(join(p, f)).isDirectory();
);
let brands = dirs("./brands");
brands.forEach((brand) => {
mix.js(
`brands/${brand}/resources/scripts/app.js`,
`public/scripts/${brand}.js`
).vue();
mix.sass(
`brands/${brand}/resources/styles/app.scss`,
`public/styles/${brand}.css`
);
});