forked from ouun/stage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
65 lines (55 loc) · 2.07 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
59
60
61
62
63
64
65
const mix = require('laravel-mix');
require('mix-tailwindcss');
require('@tinypixelco/laravel-mix-wp-blocks');
require('laravel-mix-purgecss');
require('laravel-mix-copy-watched');
require('laravel-mix-export-tailwind-config');
/*
|--------------------------------------------------------------------------
| Mix Asset Management – https://laravel-mix.com
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Stage application. By default, we are compiling the Sass file
| for your application, as well as bundling up your JS files.
|
*/
// Public Path & Development Domain
mix.setPublicPath('./dist')
.browserSync({
proxy: 'stage.test',
port: '1984',
});
// JavaScript
// Todo: .extract() is removed: https://github.com/roots/sage/issues/2204
// So there is no manifest.js file available
mix.js('resources/assets/scripts/app.js', 'scripts')
.block('resources/assets/scripts/editor.js', 'scripts');
// Styles
mix.sass('resources/assets/styles/stage.scss', 'styles')
.sass('resources/assets/styles/shop.scss', 'styles')
.sass('resources/assets/styles/blocks.scss', 'styles/blocks')
.sass('resources/assets/styles/blocks-editor.scss', 'styles/blocks')
.sass('app/Customizer/assets/styles/customizer.scss', 'styles/customizer')
.sass('app/Customizer/assets/styles/controls.scss', 'styles/customizer')
.tailwind();
// Assets
mix.copyWatched('resources/assets/images', 'dist/images')
.copyWatched('resources/assets/icons', 'dist/icons')
.copyWatched('resources/assets/fonts', 'dist/fonts')
.copyWatched('resources/languages', 'dist/languages');
// Customizer Scripts
mix.copyWatched('app/Customizer/assets/scripts', 'dist/scripts/customizer');
// Autoload
mix.autoload({
jquery: ['$', 'window.jQuery'],
});
// Options
mix.options({
processCssUrls: false,
});
// Generate source maps when not in production
mix.sourceMaps(false, 'source-map')
.version();
// Export Tailwind config to json
mix.exportTailwindConfig('tailwind.config.js', 'tailwind.config.json');