-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.mix.js
More file actions
98 lines (91 loc) · 2.94 KB
/
Copy pathwebpack.mix.js
File metadata and controls
98 lines (91 loc) · 2.94 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
const mix = require('laravel-mix');
const path = require('path');
/*
|--------------------------------------------------------------------------
| 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.
|
*/
// var BrotliGzipPlugin = require('brotli-gzip-webpack-plugin');
mix.webpackConfig({
module: {
rules: [
{
test: /\.(graphql|gql)$/,
loader: 'graphql-tag/loader'
}
]
},
resolve: {
alias: {
'@': __dirname,
Admin: path.resolve(__dirname, 'resources/assets/js/admin/'),
Public: path.resolve(__dirname, 'resources/assets/js/'),
Fragments: path.resolve(__dirname, 'graphql/client/')
},
},
output: {
hashFunction: 'sha512'
}
});
mix.js('resources/assets/js/app.js', 'public/js').vue({ version: 2})
.sass('resources/assets/sass/app.scss', 'public/css')
.copyDirectory('resources/assets/vendor/ViewerJS', 'public/js/ViewerJS')
.browserSync({
// proxy settings for php artisan serve
// if you are using docker then change proxy to 'nginx:80'
proxy: 'localhost:8000',
files: [
'public/css/app.css',
'public/js/app.js',
'public/_admin/js/app.js',
'public/_admin/css/admin.css',
'app/**/*',
'routes/**/*',
'resources/views/**/*',
'resources/lang/**/*'
]
});
/**
* Administration
*/
mix.sass('resources/assets/sass/admin/admin-ui.scss', 'public/_admin/css')
.js('resources/assets/js/admin/app.js', 'public/_admin/js').vue({ version: 2})
.stylus('resources/assets/stylus/admin.styl', 'public/_admin/css');
mix.sass(
'resources/assets/vendor/magicsuggest/magicsuggest.scss',
'public/_admin/css'
);
mix.js(
'resources/assets/vendor/magicsuggest/magicsuggest.js',
'public/_admin/js'
).vue({ version: 2});
if (mix.inProduction()) {
mix.version();
// .webpackConfig({
// plugins: [
// new BrotliGzipPlugin({
// asset: '[path].br[query]',
// algorithm: 'brotli',
// test: /\.(js|css|html|svg)$/,
// threshold: 10240,
// minRatio: 0.8,
// quality: 11
// }),
// new BrotliGzipPlugin({
// asset: '[path].gz[query]',
// algorithm: 'gzip',
// test: /\.(js|css|html|svg)$/,
// threshold: 10240,
// minRatio: 0.8
// })
// ],
// })
// .version(); // File hash suffix in production (to bust old caches)
} else {
mix.sourceMaps(true, 'source-map');
}