pingcrm/webpack.mix.js

46 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-03-18 08:53:00 -03:00
const cssImport = require('postcss-import')
const cssNesting = require('postcss-nesting')
const mix = require('laravel-mix')
const path = require('path')
2019-12-18 16:14:40 -03:00
const purgecss = require('@fullhuman/postcss-purgecss')
2019-03-18 08:53:00 -03:00
const tailwindcss = require('tailwindcss')
2019-03-05 18:10:11 -03:00
/*
|--------------------------------------------------------------------------
| 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 the application as well as bundling up all the JS files.
|
*/
mix.js('resources/js/app.js', 'public/js')
2019-12-18 16:14:40 -03:00
.postCss('resources/css/app.css', 'public/css/app.css')
.options({
postCss: [
cssImport(),
cssNesting(),
2020-01-09 00:16:10 -03:00
tailwindcss('tailwind.config.js'),
2019-12-18 16:14:40 -03:00
...mix.inProduction() ? [
purgecss({
content: ['./resources/views/**/*.blade.php', './resources/js/**/*.vue'],
defaultExtractor: content => content.match(/[\w-/:.]+(?<!:)/g) || [],
2019-12-18 18:01:48 -03:00
whitelistPatternsChildren: [/nprogress/],
2019-12-18 16:14:40 -03:00
}),
] : [],
],
})
2019-03-18 08:53:00 -03:00
.webpackConfig({
output: { chunkFilename: 'js/[name].js?id=[chunkhash]' },
2019-03-18 08:53:00 -03:00
resolve: {
alias: {
2019-12-18 15:28:09 -03:00
vue$: 'vue/dist/vue.runtime.esm.js',
2019-03-18 08:53:00 -03:00
'@': path.resolve('resources/js'),
},
},
})
.version()
2019-04-22 12:25:49 -03:00
.sourceMaps()