File tree Expand file tree Collapse file tree 6 files changed +12
-24
lines changed
Expand file tree Collapse file tree 6 files changed +12
-24
lines changed Original file line number Diff line number Diff line change 11import { bundle } from "./tools/bundle.mjs";
22import { bundle_css } from "./tools/css.mjs";
33import { node_modules_external } from "./tools/externals.mjs";
4- import { getarg } from "./tools/getarg.mjs";
54
6- import { transform } from "lightningcss";
75import fs from "fs";
86import cpy from "cpy";
97
@@ -24,8 +22,6 @@ async function build() {
2422 await bundle_css();
2523
2624 // Copy HTML
27- fs.mkdirSync("dist/html", { recursive: true });
28- cpy("src/html/*", "dist/html");
2925 cpy("src/html/*", "dist/");
3026
3127 // Copy images
@@ -34,9 +30,9 @@ async function build() {
3430
3531 await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1));
3632
37- // Copy from dist to python
33+ // Copy servable assets to python extension (exclude esm/)
3834 fs.mkdirSync("../{{ module }}/extension", { recursive: true });
39- cpy("dist/**/*", "../{{ module }}/extension");
35+ cpy("dist/**/*", "../{{ module }}/extension", { filter: (file) => !file.relativePath.startsWith("esm") } );
4036}
4137
4238build();
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ const bundle_one = async (file, resolver) => {
3535 resolver : resolver || DEFAULT_RESOLVER ,
3636 } ) ;
3737 const outName = path . basename ( file ) ;
38- fs . mkdirSync ( "./dist" , { recursive : true } ) ;
39- fs . writeFileSync ( path . join ( "./dist" , outName ) , code ) ;
38+ fs . mkdirSync ( "./dist/css " , { recursive : true } ) ;
39+ fs . writeFileSync ( path . join ( "./dist/css " , outName ) , code ) ;
4040} ;
4141
4242export const bundle_css = async ( root = "src/css/index.css" , resolver = null ) => {
Original file line number Diff line number Diff line change 11import { bundle } from "./tools/bundle.mjs";
22import { bundle_css } from "./tools/css.mjs";
33import { node_modules_external } from "./tools/externals.mjs";
4- import { getarg } from "./tools/getarg.mjs";
54
6- import { transform } from "lightningcss";
75import fs from "fs";
86import cpy from "cpy";
97
@@ -24,8 +22,6 @@ async function build() {
2422 await bundle_css();
2523
2624 // Copy HTML
27- fs.mkdirSync("dist/html", { recursive: true });
28- cpy("src/html/*", "dist/html");
2925 cpy("src/html/*", "dist/");
3026
3127 // Copy images
@@ -34,9 +30,9 @@ async function build() {
3430
3531 await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1));
3632
37- // Copy from dist to python
33+ // Copy servable assets to python extension (exclude esm/)
3834 fs.mkdirSync("../{{ module }}/extension", { recursive: true });
39- cpy("dist/**/*", "../{{ module }}/extension");
35+ cpy("dist/**/*", "../{{ module }}/extension", { filter: (file) => !file.relativePath.startsWith("esm") } );
4036}
4137
4238build();
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ const bundle_one = async (file, resolver) => {
3535 resolver : resolver || DEFAULT_RESOLVER ,
3636 } ) ;
3737 const outName = path . basename ( file ) ;
38- fs . mkdirSync ( "./dist" , { recursive : true } ) ;
39- fs . writeFileSync ( path . join ( "./dist" , outName ) , code ) ;
38+ fs . mkdirSync ( "./dist/css " , { recursive : true } ) ;
39+ fs . writeFileSync ( path . join ( "./dist/css " , outName ) , code ) ;
4040} ;
4141
4242export const bundle_css = async ( root = "src/css/index.css" , resolver = null ) => {
Original file line number Diff line number Diff line change 11import { bundle } from "./tools/bundle.mjs";
22import { bundle_css } from "./tools/css.mjs";
33import { node_modules_external } from "./tools/externals.mjs";
4- import { getarg } from "./tools/getarg.mjs";
54
6- import { transform } from "lightningcss";
75import fs from "fs";
86import cpy from "cpy";
97
@@ -24,8 +22,6 @@ async function build() {
2422 await bundle_css();
2523
2624 // Copy HTML
27- fs.mkdirSync("dist/html", { recursive: true });
28- cpy("src/html/*", "dist/html");
2925 cpy("src/html/*", "dist/");
3026
3127 // Copy images
@@ -34,9 +30,9 @@ async function build() {
3430
3531 await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1));
3632
37- // Copy from dist to python
33+ // Copy servable assets to python extension (exclude esm/)
3834 fs.mkdirSync("../{{ module }}/extension", { recursive: true });
39- cpy("dist/**/*", "../{{ module }}/extension");
35+ cpy("dist/**/*", "../{{ module }}/extension", { filter: (file) => !file.relativePath.startsWith("esm") } );
4036}
4137
4238build();
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ const bundle_one = async (file, resolver) => {
3535 resolver : resolver || DEFAULT_RESOLVER ,
3636 } ) ;
3737 const outName = path . basename ( file ) ;
38- fs . mkdirSync ( "./dist" , { recursive : true } ) ;
39- fs . writeFileSync ( path . join ( "./dist" , outName ) , code ) ;
38+ fs . mkdirSync ( "./dist/css " , { recursive : true } ) ;
39+ fs . writeFileSync ( path . join ( "./dist/css " , outName ) , code ) ;
4040} ;
4141
4242export const bundle_css = async ( root = "src/css/index.css" , resolver = null ) => {
You can’t perform that action at this time.
0 commit comments