forked from spatie/freek.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
40 lines (31 loc) · 1.06 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
const mix = require('laravel-mix');
require('laravel-mix-purgecss');
mix.js('resources/js/app.js', 'public/js')
.postCss('resources/css/app.css', 'public/css', [require('tailwindcss')('tailwind.config.js')])
.options({
processCssUrls: false,
})
.version()
.babelConfig({
plugins: ['@babel/plugin-syntax-dynamic-import', '@babel/plugin-transform-react-jsx'],
})
.webpackConfig({
output: {
chunkFilename: 'js/[name].js',
},
resolve: {
alias: {
react: 'preact-compat',
'react-dom': 'preact-compat',
},
},
})
.purgeCss({
globs: [
path.join(__dirname, 'node_modules/simplemde/**/*.js'),
path.join(__dirname, 'node_modules/turbolinks/**/*.js'),
path.join(__dirname, 'vendor/spatie/menu/**/*.php'),
path.join(__dirname, 'vendor/scrivo/highlight.php/**/*.php'),
],
whitelistPatterns: [/carbon/, /language/, /hljs/, /cm-/, /alert-/, /page/, /iframe/],
});