-
Notifications
You must be signed in to change notification settings - Fork 18
/
webpack.mix.js
64 lines (61 loc) · 2.13 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
60
61
62
63
64
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| 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.
|
*/
mix.setPublicPath('public/')
.js('resources/js/app.js', 'js/app.js')
.extract([ //Extract these to vendor.js
'jquery',
'jquery-ui/ui/widgets/tooltip',
'vue',
'vue-router',
'vuex',
'vue-analytics',
'uikit'
// 'vegas', //Causes Errors if here!
])
.scripts('resources/js/legacy/*', 'public/js/legacy.js') //Combine all the legacy files into one
.sass('resources/sass/app.scss', 'css')
.sass('resources/sass/vendor.scss', 'css')
.options({
postCss: [
//This lets us use @import on urls
require('postcss-import-url')({
modernBrowser: true
}),
require('postcss-url')([
//Preprocessing so we accurately grab url('~packageName/...')
{
filter: (asset) => asset.url.startsWith('~'),
url: (asset) => process.cwd() + '/node_modules/' + asset.url.substring(1),
multi: true,
},
// This lets us inline most CSS images
{
url: 'inline',
maxSize: 10,
},
//Handle everything pointing to the public folder
{
filter: (asset) => !asset.url.startsWith('~'),
url: 'inline',
maxSize: 10,
ignoreFragmentWarning: true,
basePath: process.cwd() + '/' + mix.config.publicPath,
}
]),
]
});
//Do Hot model reloading on port 3030, so we can test the site on port 8080
mix.options({
hmrOptions: {
port: '3030'
}
});