-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
27 lines (23 loc) · 887 Bytes
/
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
const childProcess = require('child_process');
const mix = require('laravel-mix');
const fs = require('fs-extra');
const yaml = require('js-yaml');
mix.setPublicPath('./dist');
mix.sass('_resources/styles/app.scss', 'styles')
.sass('_resources/styles/abovefold.scss', '../_includes/')
.js('_resources/scripts/app.js', 'scripts')
.extract()
.options({
processCssUrls: false
})
.then(() => {
const manifest = fs.readJsonSync('./dist/mix-manifest.json');
const config = yaml.safeLoad(fs.readFileSync('./_config.yml', 'utf8'));
config.assets = manifest;
fs.writeFileSync('./_config.yml', yaml.safeDump(config));
childProcess.execSync('bundle exec jekyll build');
});
mix.copyDirectory('_resources/images', 'dist/images');
mix.copyDirectory('node_modules/leaflet/dist/images', 'dist/styles/images');
mix.sourceMaps(false, 'source-map')
.version();