-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
67 lines (61 loc) · 1.4 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
/**
* Laravel Mix Configuration
*
* We use Laravel Mix as an easy-to-understand interface for webpack,
* which can otherwise be quite complicated. Mix is super simple and
* works very well.
*
* @link https://laravel.com/docs/5.6/mix
*
* @author Bernskiold Media <[email protected]>
**/
const mix = require( "laravel-mix" );
/**************************************************************
* Build Process
*
* This part handles all the compilation and concatenation of
* all the theme's resources.
*************************************************************/
/*
* Asset Directory Path
*/
const assetPaths = {
scripts: "assets/scripts",
};
/*
* Builds sources maps for assets.
* if we are not in production.
*
* @link https://laravel.com/docs/5.6/mix#css-source-maps
*/
if ( ! mix.inProduction() ) {
mix.sourceMaps();
}
/**
* Internal JavaScript
*/
mix.react(
`${assetPaths.scripts}/src/editor.js`,
`${assetPaths.scripts}/dist/editor.js`
);
/*
* Custom Webpack Config
*
* @link https://laravel.com/docs/6.x/mix#custom-webpack-configuration
* @link https://webpack.js.org/configuration/
*/
mix.webpackConfig( {
mode: mix.inProduction() ? "production":"development",
devtool: mix.inProduction() ? "":"cheap-source-map",
stats: "minimal",
performance: {
hints: false
},
externals: {
jquery: "jQuery",
react: "React",
},
watchOptions: {
ignored: /node_modules/
}
} );