@grame/faustwasm 0.0.46 → 0.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grame/faustwasm",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
4
4
  "description": "WebAssembly version of Faust Compiler",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/esm/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  //@ts-check
2
2
  import * as fs from "fs";
3
3
  import * as path from "path";
4
- import { cpSync } from "../fileutils.js";
4
+ import { cpSync, rmSync } from "../fileutils.js";
5
5
  import { fileURLToPath } from "url";
6
6
 
7
7
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -14,7 +14,12 @@ const copyWebStandaloneAssets = (outputDir) => {
14
14
  console.log(`Writing assets files.`)
15
15
  const assetsPath = path.join(__dirname, "../assets/standalone");
16
16
  if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir);
17
+ // Copy all files
17
18
  cpSync(assetsPath, outputDir);
19
+ // Then remove template files
20
+ rmSync(path.join(outputDir, "/template.js"));
21
+ rmSync(path.join(outputDir, "/template.html"));
22
+ rmSync(path.join(outputDir, "/template-poly.html"));
18
23
  };
19
24
 
20
25
  /**
@@ -23,6 +28,7 @@ const copyWebStandaloneAssets = (outputDir) => {
23
28
  const copyTemplate = (outputDir, poly = false) => {
24
29
  console.log(`Writing index file.`)
25
30
  if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir);
31
+ // Copy some files
26
32
  const templateJSPath = path.join(__dirname, "../assets/standalone/template.js");
27
33
  const templateHTMLPath = (poly) ? path.join(__dirname, "../assets/standalone/template-poly.html") : path.join(__dirname, "../assets/standalone/template.html");
28
34
  const faustwasmPath = path.join(__dirname, "../assets/standalone/faustwasm");