-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebpack.mix.js
43 lines (36 loc) · 1.42 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
/*
* Tutor_Starter uses Laravel Mix
*
* Check the documentation at
* https://laravel.com/docs/7.x/mix
*/
let mix = require('laravel-mix');
mix.webpackConfig({
externals: {
'react': 'React',
'react-dom': 'ReactDOM'
}
});
// Autloading jQuery to make it accessible to all the packages
// 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/app.min.js')
.js('assets/src/scripts/customizer-preview.js', 'assets/dist/js/customizer-preview.min.js')
.react('inc/Api/Customizer/reactjs/src/customizer-controls.js', 'assets/dist/js')
.react('inc/Custom/Schema/schemajs/src/tutor-schema.js', 'assets/dist/js')
.react('inc/Custom/Page/reactjs/src/tutorstarter-page-settings.js', 'assets/dist/js')
.react('inc/Setup/Settings/reactjs/src/tutorstarter-dashboard.js', 'assets/dist/js')
.sass('assets/src/sass/style.scss', 'assets/dist/css/style.min.css')
.sass('assets/src/sass/admin.scss', 'assets/dist/css/admin.min.css')
.sass('inc/Api/Customizer/reactjs/src/sass/all-controls.scss', 'assets/dist/css/all-controls.min.css')
.sass('inc/Setup/Settings/reactjs/src/sass/dashboard.scss', 'assets/dist/css/dashboard.min.css')
// Disable notification
mix.disableNotifications();
// Add versioning to assets in production environment
if (mix.inProduction()) {
mix.version();
}