Skip to content

Commit

Permalink
an alternative build script to support build on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
talshani committed Jul 9, 2022
1 parent f468379 commit f078a3b
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 28 deletions.
11 changes: 0 additions & 11 deletions packages/ladle/build-cjs.sh

This file was deleted.

14 changes: 14 additions & 0 deletions packages/ladle/build-cjs.shell.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env zx
import "zx/globals";

await fs.copy("lib/app", "cjs/lib/app");
await $`pnpm babel lib/cli --out-dir cjs/lib/cli --plugins=@babel/plugin-transform-modules-commonjs`;
await $`pnpm babel lib/shared --out-dir cjs/lib/shared --plugins=@babel/plugin-transform-modules-commonjs`;
await $`pnpm babel api --out-dir cjs/api --plugins=@babel/plugin-transform-modules-commonjs`;
await fs.copy("lib/shared/types.ts", "cjs/lib/shared/types.ts");
await fs.copy(
"lib/cli/openChrome.applescript",
"cjs/lib/cli/openChrome.applescript",
);
await fs.copy("lib/shared/default-config.js", "cjs/lib/app/src/def-config.ts");
await $`node ./build-cjs.js`;
5 changes: 3 additions & 2 deletions packages/ladle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"scripts": {
"cli": "node ./lib/cli/cli.js",
"clean": "rimraf dist && rimraf .ladle && rimraf build && rimraf *.tsbuildinfo",
"build": "./build-cjs.sh",
"build": "zx build-cjs.shell.mjs",
"serve": "node ./lib/cli/cli.js serve",
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest"
},
Expand Down Expand Up @@ -86,7 +86,8 @@
"jest": "^28.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^2.70.1"
"rollup": "^2.70.1",
"zx": "^7.0.7"
},
"jest": {
"transform": {
Expand Down
156 changes: 141 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f078a3b

Please sign in to comment.