Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions cppjswasm/js/build.mjs.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { bundle } from "./tools/bundle.mjs";
import { bundle_css } from "./tools/css.mjs";
import { node_modules_external } from "./tools/externals.mjs";
import { getarg } from "./tools/getarg.mjs";

import { transform } from "lightningcss";
import fs from "fs";
import cpy from "cpy";

Expand All @@ -24,8 +22,6 @@ async function build() {
await bundle_css();

// Copy HTML
fs.mkdirSync("dist/html", { recursive: true });
cpy("src/html/*", "dist/html");
cpy("src/html/*", "dist/");

// Copy images
Expand All @@ -34,9 +30,11 @@ async function build() {

await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1));

// Copy from dist to python
// Copy servable assets to python extension (exclude esm/)
fs.mkdirSync("../{{ module }}/extension", { recursive: true });
cpy("dist/**/*", "../{{ module }}/extension");
cpy("dist/**/*", "../{{ module }}/extension", {
filter: (file) => !file.relativePath.startsWith("esm"),
});
}

build();
4 changes: 2 additions & 2 deletions cppjswasm/js/tools/css.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const bundle_one = async (file, resolver) => {
resolver: resolver || DEFAULT_RESOLVER,
});
const outName = path.basename(file);
fs.mkdirSync("./dist", { recursive: true });
fs.writeFileSync(path.join("./dist", outName), code);
fs.mkdirSync("./dist/css", { recursive: true });
fs.writeFileSync(path.join("./dist/css", outName), code);
};

export const bundle_css = async (root = "src/css/index.css", resolver = null) => {
Expand Down
10 changes: 4 additions & 6 deletions js/js/build.mjs.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { bundle } from "./tools/bundle.mjs";
import { bundle_css } from "./tools/css.mjs";
import { node_modules_external } from "./tools/externals.mjs";
import { getarg } from "./tools/getarg.mjs";

import { transform } from "lightningcss";
import fs from "fs";
import cpy from "cpy";

Expand All @@ -24,8 +22,6 @@ async function build() {
await bundle_css();

// Copy HTML
fs.mkdirSync("dist/html", { recursive: true });
cpy("src/html/*", "dist/html");
cpy("src/html/*", "dist/");

// Copy images
Expand All @@ -34,9 +30,11 @@ async function build() {

await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1));

// Copy from dist to python
// Copy servable assets to python extension (exclude esm/)
fs.mkdirSync("../{{ module }}/extension", { recursive: true });
cpy("dist/**/*", "../{{ module }}/extension");
cpy("dist/**/*", "../{{ module }}/extension", {
filter: (file) => !file.relativePath.startsWith("esm"),
});
}

build();
4 changes: 2 additions & 2 deletions js/js/tools/css.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const bundle_one = async (file, resolver) => {
resolver: resolver || DEFAULT_RESOLVER,
});
const outName = path.basename(file);
fs.mkdirSync("./dist", { recursive: true });
fs.writeFileSync(path.join("./dist", outName), code);
fs.mkdirSync("./dist/css", { recursive: true });
fs.writeFileSync(path.join("./dist/css", outName), code);
};

export const bundle_css = async (root = "src/css/index.css", resolver = null) => {
Expand Down
10 changes: 4 additions & 6 deletions rustjswasm/js/build.mjs.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { bundle } from "./tools/bundle.mjs";
import { bundle_css } from "./tools/css.mjs";
import { node_modules_external } from "./tools/externals.mjs";
import { getarg } from "./tools/getarg.mjs";

import { transform } from "lightningcss";
import fs from "fs";
import cpy from "cpy";

Expand All @@ -24,8 +22,6 @@ async function build() {
await bundle_css();

// Copy HTML
fs.mkdirSync("dist/html", { recursive: true });
cpy("src/html/*", "dist/html");
cpy("src/html/*", "dist/");

// Copy images
Expand All @@ -34,9 +30,11 @@ async function build() {

await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1));

// Copy from dist to python
// Copy servable assets to python extension (exclude esm/)
fs.mkdirSync("../{{ module }}/extension", { recursive: true });
cpy("dist/**/*", "../{{ module }}/extension");
cpy("dist/**/*", "../{{ module }}/extension", {
filter: (file) => !file.relativePath.startsWith("esm"),
});
}

build();
4 changes: 2 additions & 2 deletions rustjswasm/js/tools/css.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const bundle_one = async (file, resolver) => {
resolver: resolver || DEFAULT_RESOLVER,
});
const outName = path.basename(file);
fs.mkdirSync("./dist", { recursive: true });
fs.writeFileSync(path.join("./dist", outName), code);
fs.mkdirSync("./dist/css", { recursive: true });
fs.writeFileSync(path.join("./dist/css", outName), code);
};

export const bundle_css = async (root = "src/css/index.css", resolver = null) => {
Expand Down
Loading