-
Notifications
You must be signed in to change notification settings - Fork 17
/
webpack.mix.js
41 lines (38 loc) · 1.03 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
const path = require('path')
const mix = require('laravel-mix')
require('laravel-mix-versionhash')
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const tailwindcss = require('tailwindcss')
mix
.js('resources/js/app.js', 'public/dist/js')
.vue({
extractStyles: true
})
.sass('resources/sass/app.scss', 'public/dist/css')
.options({
processCssUrls: false,
postCss: [ tailwindcss('./tailwind.config.js') ]
})
.disableNotifications()
if (mix.inProduction()) {
mix
// .extract() // Disabled until resolved: https://github.com/JeffreyWay/laravel-mix/issues/1889
.version() // Use `laravel-mix-versionhash` for the generating correct Laravel Mix manifest file.
} else {
mix.sourceMaps()
}
mix.webpackConfig({
plugins: [
// new BundleAnalyzerPlugin()
],
resolve: {
extensions: ['.js', '.json', '.vue'],
alias: {
'~': path.join(__dirname, './resources/js')
}
},
output: {
chunkFilename: 'dist/js/[chunkhash].js',
path: path.resolve(__dirname, './public')
}
})