-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
59 lines (54 loc) · 1.43 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
56
57
58
59
const mix = require('laravel-mix')
const fs = require('fs')
const { externals, resolve, plugins } = require('./webpack.config.js')
mix.webpackConfig({
externals,
resolve,
plugins,
output: {
chunkFilename: mix.inProduction() ? 'js/[name].[chunkhash].js' : 'js/[name].js',
publicPath: mix.inProduction() ? '/' : 'http://127.0.0.1:8080/'
},
devServer: {
port: 8080,
proxy: {
'/': 'http://127.0.0.1:8000/'
}
},
module: {
rules: [
{
test: /\.scss$/,
loader: "sass-loader",
options: {
prependData: `
@import "resources/assets/sass/partials/_vars.scss";
@import "resources/assets/sass/partials/_mixins.scss";
`
}
}
]
}
})
mix.setResourceRoot('./')
if (mix.config.hmr) {
// Somehow public/hot isn't being removed by Mix. We'll handle it ourselves.
process.on('SIGINT', () => {
try {
fs.unlinkSync(mix.config.publicPath + '/hot')
} catch (e) {
}
process.exit()
})
} else {
mix.copy('resources/assets/img', 'public/img', false)
.copy('node_modules/font-awesome/fonts', 'public/fonts', false)
}
mix.ts('resources/assets/js/app.ts', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.ts('resources/assets/js/remote/app.ts', 'public/js/remote')
.sass('resources/assets/sass/remote.scss', 'public/css')
if (mix.inProduction()) {
mix.version()
mix.disableNotifications()
}