-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
59 lines (53 loc) · 1.55 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
/*
* Fix for the error
* https://github.com/JeffreyWay/laravel-mix/issues/504
*/
const path = require('path');
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');
mix.webpackConfig({
resolve: {
alias: {
// 'bs3': path.resolve(__dirname, 'node_modules/bootstrap-sass/assets/stylesheets/bootstrap')
'~3pc': path.resolve(__dirname, 'client/3pc'), // third party components
},
fallback: {
'stream': require.resolve('stream-browserify'),
'http': require.resolve('stream-http'),
'https': require.resolve('https-browserify'),
'zlib': require.resolve('browserify-zlib'),
},
},
resolveLoader: {
alias: {
svgSprite: path.resolve('./webpack/svgSpriteLoader.js'),
},
},
stats: {
children: false,
},
});
mix.autoload({
jquery: ['$', 'window.jQuery'],
});
mix.options({
processCssUrls: true,
});
const jsPath = './client/js',
scssPath = './client/sass';
// non-standard modules
mix.js(`${jsPath}/client.js`, '');
mix.sass(`${scssPath}/client.scss`, '');
if (mix.inProduction()) {
mix.version();
}