-
Notifications
You must be signed in to change notification settings - Fork 29
/
webpack.mix.js
66 lines (61 loc) · 1.79 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
const mix = require('laravel-mix');
require('laravel-mix-bundle-analyzer');
require('laravel-mix-compress');
require('laravel-mix-clean');
require('laravel-mix-sri');
require('laravel-mix-serve');
require('laravel-mix-workbox');
require('laravel-mix-polyfill');
const compiler = require('./resources/frontend/compiler/index');
if (mix.isWatching()) {
mix.bundleAnalyzer();
}
process.env.MIX_APP_VERSION = process.env.APP_VERSION;
process.env.MIX_DOCKER_VERSION = process.env.IMAGE_VERSION;
process.env.MIX_PUSHER_APP_KEY = process.env.PUSHER_APP_KEY;
process.env.MIX_PUSHER_SCHEME = process.env.PUSHER_SCHEME;
process.env.MIX_SENTRY_DSN = process.env.SENTRY_DSN;
mix.before(() => {
compiler();
})
.alias({
'@': 'resources/frontend/core',
_app: 'resources/frontend',
_modules: 'resources/frontend/vendor_modules',
_internal: 'resources/frontend/core/modules',
})
.sass('resources/frontend/core/sass/app.scss', 'dist')
.js('resources/frontend/main.js', 'dist/app.js')
.vue({
extractStyles: true,
version: 2,
globalStyles: 'resources/frontend/core/sass/includes/variables.scss',
})
.polyfill({
enabled: true,
useBuiltIns: 'usage',
targets: false,
})
.version()
.compress()
.serve({
args: ['artisan', 'serve', '--host=0.0.0.0'],
dev: false,
})
.generateIntegrityHash()
.generateSW({
swDest: 'sw.js',
})
.clean({
cleanOnceBeforeBuildPatterns: ['**/*', '!index.php', '!robots.txt', '!vendor/**', '!favicon.ico', '!storage/**'],
})
.webpackConfig({
output: {
publicPath: '/',
},
resolve: {
fallback: {
path: require.resolve('path-browserify'),
},
},
});