forked from largezhou/wechat-menu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
38 lines (35 loc) · 991 Bytes
/
webpack.mix.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const mix = require('laravel-mix')
const webpack = require('webpack')
const path = require('path')
// 修改生成 mix-manifest.json 文件的位置
Mix.manifest.refresh = function() {
Mix.inProduction()
&& File.find(path.join('resources', this.name))
.makeDirectories()
.write(this.manifest)
}
const target = Mix.inProduction() ? 'public' : 'public-dev'
mix
.options({
uglify: {
uglifyOptions: {
compress: {
drop_console: true,
},
},
},
})
.setPublicPath(target)
.setResourceRoot('/vendor/wechat-menu')
.js('resources/js/app.js', target)
.sass('resources/sass/app.scss', target)
.copy(target, '../test_wechat_menu/public/vendor/wechat-menu')
.version()
.webpackConfig({
resolve: {
symlinks: false,
alias: {
'@': path.resolve(__dirname, 'resources/js/'),
},
},
})