Exclude olm from the webpack
Olm takes *ages* to webpack, and it doesn't compress well. So, serve it as a separate asset to the browser.
This commit is contained in:
parent
2829d95705
commit
51b74251f9
4 changed files with 39 additions and 24 deletions
21
scripts/staticfiles.js
Executable file
21
scripts/staticfiles.js
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
// copy static files from node_modules to the vector directory
|
||||
//
|
||||
|
||||
var fs = require('fs-extra');
|
||||
|
||||
function exists(f) {
|
||||
try {
|
||||
fs.statSync(f);
|
||||
return true;
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const olm = 'node_modules/olm/olm.js';
|
||||
if (exists(olm)) {
|
||||
console.log("copy", olm, "-> vector");
|
||||
fs.copySync(olm, 'vector/olm.js');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue