forked from haobeiping/tiny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
34 lines (30 loc) · 960 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
let mix = require('laravel-mix');
let path = require('path');
function resolve (dir) {
return path.join(__dirname, dir);
}
mix.webpackConfig({
module: {
rules: [
{
test: /\.(js|vue)$/,
enforce: 'pre',
include: resolve('resources/assets'),
use: [{
loader: 'eslint-loader',
options: {
formatter: require('eslint-friendly-formatter')
}
}]
}
]
}
});
// 如果网站不是更目录 setResourceRoot 设置路径
// mix.setResourceRoot('/')
mix.copy('resources/assets/backend/static/images/default_avatar.jpg', 'public/static/images/default_avatar.jpg')
.js('resources/assets/backend/app.js', 'public/js/backend').version();
mix.less('resources/assets/frontend/less/app.less', 'public/static/css')
.js('resources/assets/frontend/js/app.js', 'public/static/js')
.copy('resources/assets/frontend/images', 'public/static/images')
.version();