forked from Alecaddd/awps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
46 lines (40 loc) · 1.34 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
/*
* AWPS uses Laravel Mix
*
* Check the documentation at
* https://laravel.com/docs/5.6/mix
*/
let mix = require( 'laravel-mix' );
// BrowserSync and LiveReload on `npm run watch` command
// Update the `proxy` and the location of your SSL Certificates if you're developing over HTTPS
// mix.browserSync({
// proxy: 'https://your-local-domain',
// https: {
// key: '/your/certificates/location/your-local-domain.key',
// cert: '/your/certificates/location/your-local-domain.crt'
// },
// files: [
// '**/*.php',
// 'assets/dist/css/**/*.css',
// 'assets/dist/js/**/*.js'
// ],
// injectChanges: true,
// open: false
// });
// 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' )
.react( '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 versioning to assets in production environment
if ( mix.inProduction() ) {
mix.version();
}