Created
November 28, 2017 10:42
-
-
Save mgussekloo/38d10ea75a47df83763c1aa39258d830 to your computer and use it in GitHub Desktop.
My config for Laravel Mix with PurgeCSS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mix = require('laravel-mix'); | |
let glob = require('glob-all'); | |
let PurgecssPlugin = require('purgecss-webpack-plugin'); | |
/* | |
|-------------------------------------------------------------------------- | |
| Mix Asset Management | |
|-------------------------------------------------------------------------- | |
| | |
| Mix provides a clean, fluent API for defining some Webpack build steps | |
| for your Laravel application. By default, we are compiling the Sass | |
| file for your application, as well as bundling up your JS files. | |
| | |
*/ | |
mix.setPublicPath('static'); | |
mix.options({ processCssUrls: false }); | |
mix.webpackConfig({ | |
plugins: [ | |
new PurgecssPlugin({ | |
paths: glob.sync([ | |
path.join(__dirname, "templates/**/*.twig"), | |
path.join(__dirname, "resources/scripts/**/*.vue") | |
]) | |
}) | |
] | |
}); | |
mix.copy('resources/images', 'static/images'); | |
mix.copy('resources/fonts', 'static/fonts'); | |
mix.js('resources/scripts/app.js', 'app.js'); | |
mix.sass('resources/styles/app.scss', 'app.css'); | |
mix.version(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment