-
Notifications
You must be signed in to change notification settings - Fork 108
/
webpack.mix.js
30 lines (25 loc) · 931 Bytes
/
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
/*
* AWPS uses Laravel Mix
*
* Check the documentation at
* https://laravel-mix.com/
*/
let mix = require( 'laravel-mix' );
require( '@tinypixelco/laravel-mix-wp-blocks' );
// Autloading jQuery to make it accessible to all the packages, because, you know, reasons
// You can comment this line if you don't need jQuery.
mix.autoload({
jquery: ['$', 'window.jQuery', 'jQuery'],
});
mix.setPublicPath( './assets/dist' );
// Compile assets.
mix.js( 'assets/src/scripts/app.js', 'assets/dist/js' )
.js( 'assets/src/scripts/admin.js', 'assets/dist/js' )
.block( 'assets/src/scripts/gutenberg.js', 'assets/dist/js' )
.sass( 'assets/src/sass/style.scss', 'assets/dist/css' )
.sass( 'assets/src/sass/admin.scss', 'assets/dist/css' )
.sass( 'assets/src/sass/gutenberg.scss', 'assets/dist/css' );
// Add source map and versioning to assets in production environment.
if ( mix.inProduction() ) {
mix.sourceMaps().version();
}