Copy instead of symlinking since it seems snowpack can't pick up symlinks

This commit is contained in:
Danila Fedorin 2021-08-02 17:00:40 -07:00
parent 32b308faa7
commit 3687f1fd4a

View File

@ -75,7 +75,7 @@ async function populateLib() {
const olmDstDir = path.join(libDir, "olm/"); const olmDstDir = path.join(libDir, "olm/");
await fs.mkdir(olmDstDir); await fs.mkdir(olmDstDir);
for (const file of ["olm.js", "olm.wasm", "olm_legacy.js"]) { for (const file of ["olm.js", "olm.wasm", "olm_legacy.js"]) {
await fs.symlink(path.join(olmSrcDir, file), path.join(olmDstDir, file)); await fs.copyFile(path.join(olmSrcDir, file), path.join(olmDstDir, file));
} }
// transpile node-html-parser to esm // transpile node-html-parser to esm
await fs.mkdir(path.join(libDir, "node-html-parser/")); await fs.mkdir(path.join(libDir, "node-html-parser/"));
@ -85,7 +85,7 @@ async function populateLib() {
); );
// Symlink dompurify // Symlink dompurify
await fs.mkdir(path.join(libDir, "dompurify/")); await fs.mkdir(path.join(libDir, "dompurify/"));
await fs.symlink( await fs.copyFile(
require.resolve('dompurify/dist/purify.es.js'), require.resolve('dompurify/dist/purify.es.js'),
path.join(libDir, "dompurify/index.js") path.join(libDir, "dompurify/index.js")
); );