-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
100 lines (93 loc) · 2.66 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
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
99
100
const mix = require('laravel-mix');
const CompressionPlugin = require('compression-webpack-plugin');
const zopfli = require('@gfx/zopfli');
require('laravel-mix-polyfill');
require('laravel-mix-bundle-analyzer');
/*
|--------------------------------------------------------------------------
| 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.disableSuccessNotifications();
mix
.options({
processCssUrls: true,
purifyCss: false,
imgLoaderOptions: {
enabled: false
},
uglify: {
uglifyOptions: {
compress: {
warnings: false
},
mangle: {
safari10: true
},
parallel: true
}
}
})
mix.polyfill({
enabled: true,
useBuiltIns: "usage",
targets: "iOS 7"
})
mix.styles(['resources/css/bootstrap.css'], 'public/css/bootstrap.css')
mix.js('resources/js/main.js', 'public/js')
.extract([
'@fortawesome/free-solid-svg-icons',
'core-js',
'lodash',
'vue',
'vue-router',
'vue-cookies',
'axios',
'vuex',
'element-ui',
'prosemirror-view',
'prosemirror-model',
'prosemirror-tables',
'prosemirror-transform',
'prosemirror-state',
'prosemirror-commands',
'prosemirror-history',
'prosemirror-schema-list',
'prosemirror-inputrules',
'prosemirror-gapcursor',
'prosemirror-collab',
'prosemirror-dropcursor',
'prosemirror-keymap',
'tiptap',
'tiptap-commands',
'tiptap-extensions',
]);
if (mix.inProduction()) {
mix.sourceMaps(false)
.webpackConfig({
plugins: [
new CompressionPlugin({
//algorithm: 'gzip',
algorithm(input, compressionOptions, callback) {
return zopfli.gzip(input, compressionOptions, callback);
},
compressionOptions: {
numiterations: 15,
},
test: /\.js$|\.css$|\.html$|\.svg$/,
threshold: 8192,
}),
],
externals: {
'font-awesome': 'fontAwesome',
},
})
.version();
} else {
// mix.bundleAnalyzer();
}