1 Star 0 Fork 8

狼哥/gryen-gtd

forked from itargaryen/gryen-gtd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.mix.js 1.44 KB
一键复制 编辑 原始数据 按行查看 历史
郭成尧 提交于 2021-02-03 13:34 . fix(article): more article show err
const fs = require("fs");
const mix = require("laravel-mix");
const PKG = require("./package.json");
const DIST_PATH = "public/dist";
const DIST_PATH_WITH_VERSION = `${DIST_PATH}/${PKG.version}`;
const JS_PATH = "./resources/assets/js"; // JS 源文件根目录
const JS_MODULES = fs.readdirSync(JS_PATH); // JS 模块
/* CSS 处理 */
mix.sass(
"resources/assets/sass/lib.scss",
`${DIST_PATH_WITH_VERSION}/css/lib.css`
)
.sass(
"resources/assets/sass/app.scss",
`${DIST_PATH_WITH_VERSION}/css/app.css`
)
.sass(
"resources/assets/sass/dashboard.scss",
`${DIST_PATH_WITH_VERSION}/css/dashboard.css`
);
/* JS 处理 */
for (let module of JS_MODULES) {
if (module !== "helpers" && module !== ".DS_Store") {
mix.js(
`${JS_PATH}/${module}/index.js`,
`${DIST_PATH_WITH_VERSION}/js/${module}.bundle.js`
);
}
}
mix.extract(["jquery", "axios", "bootstrap"]).autoload({
jquery: ["$", "window.jQuery"],
axios: ["axios", "window.axios"]
});
/* Vue 处理 */
mix.js("resources/vue/publication/index.js", `${DIST_PATH_WITH_VERSION}/js/publication.js`).vue();
mix.js(
"resources/vue/dashboard/index.js",
`${DIST_PATH_WITH_VERSION}/js/dashboard.js`
).vue();
mix.webpackConfig({
optimization: {
providedExports: false,
sideEffects: false,
usedExports: false
}
}).before(() => {
fs.rmdirSync(DIST_PATH, { recursive: true });
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/7257018/gryen-gtd.git
git@gitee.com:7257018/gryen-gtd.git
7257018
gryen-gtd
gryen-gtd
master

搜索帮助