-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
55 lines (52 loc) · 1.51 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require('dotenv').config({
path: __dirname + '/.env'
});
let env = process.env
const mix = require('laravel-mix')
mix.setPublicPath('./public')
.sass('resources/sass/app.scss', 'public/css/app.css')
.js('resources/js/app.js', 'public/js/app.js')
.autoload({
axios: "axios",
nprogress: "nprogress",
vue: "Vue"
})
.extract([
"axios",
"nprogress",
"vue",
"vue-router",
"vuex"
])
.webpackConfig({
resolve : {
alias : {
'@': path.join(__dirname, 'resources/js'),
'@api' : path.join(__dirname, 'resources/js/api'),
'@components' : path.join(__dirname, 'resources/js/components'),
'@helpers' : path.join(__dirname, 'resources/js/helpers'),
'@mixins' : path.join(__dirname, 'resources/js/mixins'),
'@router' : path.join(__dirname, 'resources/js/router'),
'@store': path.join(__dirname, 'resources/js/store'),
'@views' : path.join(__dirname, 'resources/js/views')
}
}
})
//
if (mix.inProduction()) {
mix.sourceMaps(true)
.version()
.disableNotifications()
} else {
mix.sourceMaps(true)
.browserSync({
open: 'external',
host: env.DOMAIN,
proxy: env.DOMAIN,
files: [
"public/**/*.html",
"public/js/**/*.js",
"public/css/**/*.css"
]
})
}