-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.mix.js
37 lines (32 loc) · 1.41 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
const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');
const VuetifyLoaderPlugin = require('vuetify-loader/lib/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 the application as well as bundling up all the JS files.
|
*/
Mix.listen('configReady', config => {
const scssRule = config.module.rules.find(r => r.test.toString() === /\.scss$/.toString())
const scssOptions = scssRule.loaders.find(l => l.loader === 'sass-loader').options
scssOptions.data = '@import "./resources/sass/styles.scss";'
const sassRule = config.module.rules.find(r => r.test.toString() === /\.sass$/.toString())
const sassOptions = sassRule.loaders.find(l => l.loader === 'sass-loader').options
sassOptions.data = '@import "./resources/sass/styles.scss"'
});
mix.options({
extractVueStyles: true,
processCssUrls: false,
postCss: [ tailwindcss('tailwind.config.js') ],
})
.webpackConfig({
plugins: [new VuetifyLoaderPlugin()]
})
.js('resources/js/app.js', 'public/js')
.copy('resources/resource_img', 'public/resource_img')
.sass('resources/sass/app.scss', 'public/css');