2 Star 0 Fork 0

白衬衫./youmiadmin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.mix.js 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
白衬衫. 提交于 2020-10-29 17:51 . init
const mix = require('laravel-mix');
let rm = require('rimraf');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
const buildRoot = 'public/build';
const devSeverHost = 'youmi.com';
rm(buildRoot, err => {
if (err) throw err
console.log("清空编译文件夹\n\n")
});
mix.js('resources/js/app.js', buildRoot).extract(['vue'])
.sass('resources/sass/app.scss', 'public/css');
if(mix.inProduction()) {
mix.version();
mix.webpackConfig({
output: {
chunkFilename: 'build/[id].[hash].js'
},
externals: {
'vue': 'Vue',
'vue-router': 'VueRouter',
'element-ui': 'ELEMENT',
}
});
} else {
mix.webpackConfig({
output: {
chunkFilename: '[id].js'
},
externals: {
'vue': 'Vue',
'vue-router': 'VueRouter',
'element-ui': 'ELEMENT',
}
});
mix.browserSync({
proxy: devSeverHost,
files: ['resources/**/*']
}
);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/6D8CA54E5B752E676EBEA3E5046/youmiadmin.git
git@gitee.com:6D8CA54E5B752E676EBEA3E5046/youmiadmin.git
6D8CA54E5B752E676EBEA3E5046
youmiadmin
youmiadmin
master

搜索帮助