Skip to content

Commit 750d9c3

Browse files
committed
Build: updated build script
1 parent 88b8b6f commit 750d9c3

File tree

5 files changed

+8
-25
lines changed

5 files changed

+8
-25
lines changed

bun.lockb

-2.51 KB
Binary file not shown.

esbuild.config.js

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
11
import { execSync } from "child_process";
22
import { build } from "esbuild";
3-
import { globPlugin } from "esbuild-plugin-glob";
43

5-
execSync("npx rimraf ./dist && mkdir dist");
4+
execSync("rm -rf ./dist && mkdir dist");
65

76
build({
8-
entryPoints: [
9-
"./src/**/*.js",
10-
"./src/**/*.jsx",
11-
"./src/**/*.ts",
12-
"./src/**/*.tsx",
13-
"./src/**/*.png",
14-
"./src/**/*.css",
15-
"!./src/stories/**"
16-
],
17-
bundle: false,
7+
entryPoints: ["./src/index.tsx"],
8+
bundle: true,
189
outdir: "./dist",
1910
platform: "browser",
20-
format: "cjs",
11+
format: "esm",
2112
minify: true,
2213
sourcemap: true,
2314
keepNames: true,
24-
plugins: [globPlugin()],
25-
inject: ["./injections/react-shim.js"],
2615
loader: {
27-
".png": "copy",
28-
".css": "copy"
16+
".png": "file"
2917
}
30-
}).catch(() => process.exit(1));
18+
});

injections/react-shim.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
"autoprefixer": "10.4.14",
8686
"bun-types": "1.0.21",
8787
"esbuild": "0.19.12",
88-
"esbuild-plugin-glob": "2.2.2",
8988
"eslint": "8.49.0",
9089
"eslint-plugin-mdx": "2.1.0",
9190
"eslint-plugin-react": "7.33.2",
@@ -94,7 +93,6 @@
9493
"lefthook": "1.4.3",
9594
"postcss": "8.4.23",
9695
"prettier": "2.8.8",
97-
"rimraf": "5.0.1",
9896
"storybook": "7.3.2",
9997
"storybook-addon-react-router-v6": "1.0.2",
10098
"tailwindcss": "3.3.2",

src/components/workspace/crosshairs.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export const Crosshairs = ({ render }) => {
3131

3232
const workspace = document.getElementById(ids.workspace)?.getBoundingClientRect();
3333

34-
const x1 = x - workspace?.left ?? 0;
35-
const y1 = y - workspace?.top ?? 0;
34+
const x1 = x - workspace.left ?? 0;
35+
const y1 = y - workspace.top ?? 0;
3636

3737
if (x1 < 0 || y1 < 0) return null;
3838

0 commit comments

Comments
 (0)