-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
40 lines (38 loc) · 1.13 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
let mix = require('laravel-mix');
let Path = require('path');
let ImageminPlugin = require('imagemin-webpack-plugin').default;
let CopyWebpackPlugin = require('copy-webpack-plugin');
let imageminMozjpeg = require('imagemin-mozjpeg');
mix.webpackConfig({
resolve: {
alias: {
// "TweenLite": Path.resolve('node_modules', 'gsap/src/uncompressed/TweenLite.js'),
}
},
node: {
fs: "empty"
},
plugins: [
//Compress images
new CopyWebpackPlugin([{
from: 'resources/img', // FROM
to: 'img/', // TO
}]),
new ImageminPlugin({
test: /\.(jpe?g|png|gif|svg)$/i,
pngquant: {
quality: '65-80'
},
plugins: [
imageminMozjpeg({
quality: 65,
//Set the maximum memory to use in kbytes
// maxmemory: 1000 * 512
})
]
})
],
})
.js('resources/js/app.js', 'public/js')
// .react('resources/js/react-app.js', 'public/js')
.sass('resources/sass/style.sass', 'public/css').sourceMaps();