forked from mishterk/wp-tailwindcss-theme-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
46 lines (39 loc) · 1019 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const mix = require('laravel-mix');
const local = require('./local');
const glob = require('glob-all');
require('laravel-mix-versionhash');
require('laravel-mix-tailwind');
require('laravel-mix-purgecss');
mix.setPublicPath('./build');
mix.webpackConfig({
externals: {
"jquery": "jQuery",
}
});
if (local.proxy) {
mix.browserSync({
proxy: local.proxy,
injectChanges: true,
open: false,
files: [
'build/**/*.{css,js}',
'templates/**/*.php'
]
});
}
mix.tailwind();
mix.js('assets/js/app.js', 'js');
mix.sass('assets/scss/app.scss', 'css');
// The package internally limits running to production builds so we don't need
// to wrap this up with a condition.
mix.purgeCss({
paths: () => glob.sync([
path.join(__dirname, '*.php'),
path.join(__dirname, 'templates/**/*.php'),
path.join(__dirname, 'build/js/**/*.js'),
]),
});
if (mix.inProduction()) {
mix.versionHash();
mix.sourceMaps();
}