Skip to content

Commit

Permalink
tweak build script jsx option
Browse files Browse the repository at this point in the history
  • Loading branch information
DakotahGodfrey committed Nov 12, 2024
1 parent ead2fd2 commit ec37971
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
22 changes: 10 additions & 12 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const { execSync } = require("child_process")
const esbuild = require("esbuild")
const path = require("path")
const { Generator } = require('npm-dts');
const { execSync } = require("child_process");
const esbuild = require("esbuild");
const path = require("path");
const { Generator } = require("npm-dts");

new Generator({
entry: path.resolve(__dirname, "stories/index.ts"),
output: path.resolve(__dirname, 'dist/index.d.ts'),
output: path.resolve(__dirname, "dist/index.d.ts"),
tsc: "--emitDeclarationOnly --project tsconfig.lib.json"
}).generate();

// Run TypeScript to generate type declarations using the new tsconfig.lib.json
execSync("tsc --emitDeclarationOnly --project tsconfig.lib.json", { stdio: "inherit" })
execSync("tsc --emitDeclarationOnly --project tsconfig.lib.json", { stdio: "inherit" });

const context = {
logLevel: "info",
Expand All @@ -21,8 +21,8 @@ const context = {
target: ["esnext"],
minify: true,
pure: ["React.createElement"],
jsx: 'transform',
loader: { '.js': 'jsx' },
jsx: "automatic",
loader: { ".js": "jsx" },
outdir: path.resolve(__dirname, "dist"),
sourcemap: true,
external: [
Expand All @@ -38,9 +38,7 @@ const context = {
"react-icons"
],
format: "esm"
}
};

// Build script using esbuild
esbuild
.build(context)
.catch(() => process.exit(1))
esbuild.build(context).catch(() => process.exit(1));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agility/plenum-ui",
"version": "2.1.16",
"version": "2.1.17",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down

0 comments on commit ec37971

Please sign in to comment.