-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
46 lines (38 loc) · 1.14 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
42
43
44
45
46
const mix = require('laravel-mix');
const destDir = 'public';
mix.extend(
'zip',
new class {
register(src, dest, file) {
this.src = src;
this.dest = dest;
this.file = file;
}
dependencies() {
this.requiresReload = true;
return ['filemanager-webpack-plugin@2.*']
}
webpackRules() { }
webpackPlugins() {
const FileManagerPlugin = require('filemanager-webpack-plugin');
return [
new FileManagerPlugin({
onEnd: {
mkdir: [
this.dest
],
archive: [
{ source: this.src, destination: `${this.dest}/${this.file}` }
]
}
})
]
}
// ...
}()
);
mix.sass('src/sass/site.scss', `${destDir}/css`)
.copy('src/helpers', `${destDir}/helpers`)
.copy('src/layouts', `${destDir}/layouts`)
.copy('src/partials', `${destDir}/partials`)
.zip('public', 'build', 'bundle.zip');