-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
setup.js
26 lines (20 loc) · 811 Bytes
/
setup.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
'use strict';
const fs = require('fs');
const path = require('path');
// vendored dependencies:
// https://github.com/davidcalhoun/energize.js
// https://github.com/bartaz/sandbox.js/blob/master/jquery.highlight.js
let nmPath = './node_modules';
if (!fs.existsSync(path.resolve(nmPath,'jquery'))) {
nmPath = '..';
}
// no longer using symlinks due to cross-platform issues and
// https://github.com/11ty/eleventy/issues/530
try {
fs.copyFileSync(path.resolve(nmPath,'jquery/dist/jquery.min.js'),'./source/slate/js/lib/jquery.min.js');
fs.copyFileSync(path.resolve(nmPath,'lunr/lunr.min.js'),'./source/slate/js/lib/lunr.min.js');
fs.copyFileSync(path.resolve(nmPath,'imagesloaded/imagesloaded.pkgd.min.js'),'./source/slate/js/lib/imagesloaded.min.js');
}
catch (ex) {
console.warn(ex.message);
}