forked from aristath/customize-section-button
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.mix.js
54 lines (44 loc) · 1.24 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
/**
* Lavarel Mix Config.
*
* Laravel Mix is a simplified wrapper for Webpack. Use this file to add CSS/JS
* files to compile.
*
* @package CustomizeSectionButton
* @author WPTRT <[email protected]>
* @copyright 2019 WPTRT
* @license https://www.gnu.org/licenses/gpl-2.0.html GPL-2.0-or-later
* @link https://github.com/WPTRT/customize-section-button
*/
// Import required packages.
const mix = require( 'laravel-mix' );
// Set dev path.
const devPath = 'resources';
// Set public path.
mix.setPublicPath( 'public' );
// Set options.
mix.options( {
postCss : [ require( 'postcss-preset-env' )() ],
processCssUrls : false
} );
// Source maps.
mix.sourceMaps();
// Versioning and cache-busting with `mix-manifest.json`.
mix.version();
// Compile JS.
mix.js( `${devPath}/js/customize-controls.js`, 'js' );
// Sass configuration.
var sassConfig = {
outputStyle : 'expanded',
indentType : 'tab',
indentWidth : 1
};
// Compile SASS/CSS.
mix.sass( `${devPath}/scss/customize-controls.scss`, 'css', sassConfig );
// Extra Webpack config.
mix.webpackConfig( {
stats : 'minimal',
devtool : mix.inProduction() ? false : 'source-map',
performance : { hints : false },
externals : { jquery : 'jQuery' },
} );