generated from alpas/starter
-
Notifications
You must be signed in to change notification settings - Fork 9
/
webpack.mix.js
41 lines (39 loc) · 1.25 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
let mix = require('laravel-mix')
const tailwindcss = require('tailwindcss')
const purgecss = require('@fullhuman/postcss-purgecss')
const publicPath = 'src/main/resources/web'
const resources = 'src/main/resources'
const docsPath = `${resources}/docs`
const templatesPath = `${resources}/templates`
mix
.setPublicPath(publicPath)
.js([`${resources}/js/app.js`], 'js')
.js([`${resources}/js/docs.js`, `${resources}/js/sidebar.js`], 'js')
.less(`${resources}/css/docs.less`, 'css/docs.css')
.less(`${resources}/css/app.less`, 'css/app.css')
.options({
postCss: [
tailwindcss('./tailwind.config.js'),
...mix.inProduction() ? [
purgecss({
content: [`${templatesPath}/**/*.peb`, `${resources}/js/*.js`],
defaultExtractor: content => content.match(/[\w-/:.]+(?<!:)/g) || [],
whitelist: ['clipboard'],
}),
] : [],
],
})
.version()
.disableNotifications()
if (!mix.inProduction()) {
mix.browserSync({
open: false,
notify: false,
proxy: `localhost:${process.env.MIX_APP_PORT}`,
files: [
'out/**/*',
publicPath,
docsPath
],
})
}