-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathwebpack.mix.js
46 lines (37 loc) · 1009 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 chokidar = require('chokidar');
require('laravel-mix-purgecss');
mix.react('resources/js/app.js', 'public/js');
mix.postCss('resources/css/app.css', 'public/css/app.css');
mix.autoload({
react: ['React'],
});
mix.options({
postCss: [
require('postcss-easy-import')(),
require('tailwindcss')('./tailwind.js'),
require('postcss-nested'),
require('postcss-color-mod-function'),
],
// Since we don't do any image preprocessing and write url's that are
// relative to the site root, we don't want the css loader to try to
// follow paths in `url()` functions.
processCssUrls: false,
});
mix.babelConfig({
plugins: ['@babel/plugin-syntax-dynamic-import'],
});
mix.webpackConfig({
resolve: {
extensions: ['.ts', '.tsx'],
},
devServer: {
disableHostCheck: true,
},
});
mix.purgeCss({
whitelistPatterns: [/active/],
});
if (mix.inProduction()) {
mix.version();
}