-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.mix.js
43 lines (40 loc) · 1.18 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
const mix = require('laravel-mix');
const postCssConfig = [require('tailwindcss')('./tailwind.config.js')];
if (process.env.NODE_ENV === 'production') {
postCssConfig.push(
require('@fullhuman/postcss-purgecss')({
content: [
'./resources/js/**/*.vue',
'./resources/js/**/*.js',
'./resources/sass/**/*.scss',
'./resources/views/**/*.php',
],
defaultExtractor: content =>
content.match(/[A-Za-z0-9-_:/]+/g) || [],
})
);
}
mix.webpackConfig({
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /(node_modules\/(?!(strict-uri-encode|query-string)\/).*|bower_components)/,
use: [
{
loader: 'babel-loader',
options: Config.babel(),
},
],
},
],
},
});
mix.js('resources/js/app.js', 'public/assets/js')
.sass('resources/sass/app.scss', 'public/assets/css')
.options({
processCssUrls: false,
postCss: postCssConfig,
})
.sourceMaps()
.version();