-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
58 lines (51 loc) · 1.79 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
/*
* Qubely_Starters uses Laravel Mix
*
* Check the documentation at
* https://laravel.com/docs/7.x/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: 'http://wpdev.local',
// 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
});
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')
.js('assets/src/scripts/admin.js', 'assets/dist/js')
.js('assets/src/scripts/customizer-preview.js', 'assets/dist/js')
.react('inc/Api/Customizer/reactjs/src/customizer-controls.js', 'assets/dist/js')
.react('inc/Custom/Schema/reactjs/src/qubelystarters-schema.js', 'assets/dist/js')
.react('inc/Custom/Page/reactjs/src/qubelystarters-page-settings.js', 'assets/dist/js')
.react('inc/Setup/Settings/reactjs/src/qubelystarters-dashboard.js', 'assets/dist/js')
.sass('assets/src/sass/style.scss', 'assets/dist/css')
.sass('assets/src/sass/admin.scss', 'assets/dist/css')
.sass('inc/Api/Customizer/reactjs/src/sass/all-controls.scss', 'assets/dist/css')
.sass('inc/Setup/Settings/reactjs/src/sass/dashboard.scss', 'assets/dist/css')
// Add versioning to assets in production environment
if (mix.inProduction()) {
mix.version();
}