This repository has been archived by the owner on Jun 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 148
/
webpack.mix.js
51 lines (40 loc) · 1.54 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
44
45
46
47
48
49
50
51
const mix = require('laravel-mix');
require('laravel-mix-purgecss');
mix
.js('resources/assets/js/front/app.js', 'public/js/front.app.js')
.postCss('resources/assets/css/front/front.css', 'public/css/front.css')
.js('resources/assets/js/back/app.js', 'public/js/back.app.js')
.postCss('resources/assets/css/back/back.css', 'public/css/back.css')
.version()
.options({
// Our own set of PostCSS plugins.
postCss: [
require('postcss-easy-import')(),
require('tailwindcss')('./tailwind.js'),
require('postcss-cssnext')(),
],
// CSSNext already processes our css with Autoprefixer, so we don't
// need mix to do it twice.
autoprefixer: false,
// 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,
})
.babelConfig({
plugins: ['syntax-dynamic-import'],
})
.webpackConfig({
output: {
// The public path needs to be set to the root of the site so
// Webpack can locate chunks at runtime.
publicPath: '/',
// We'll place all chunks in the `js` folder by default so we don't
// need to worry about ignoring them in our version control system.
chunkFilename: 'js/[name].js',
},
})
.purgeCss({
only: ['css/front.css'],
whitelistPatterns: [/active/],
});