build with esbuild?
This commit is contained in:
12
packages/docs/esbuild.config.ts
Normal file
12
packages/docs/esbuild.config.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import type { BuildOptions } from "esbuild"
|
||||||
|
import packageJson from "./package.json"
|
||||||
|
|
||||||
|
export const esbuildConfig: BuildOptions = {
|
||||||
|
entryPoints: [packageJson.source],
|
||||||
|
bundle: true,
|
||||||
|
outfile: packageJson.main,
|
||||||
|
format: "esm",
|
||||||
|
target: "node16",
|
||||||
|
platform: "node",
|
||||||
|
external: Object.keys(packageJson.dependencies),
|
||||||
|
}
|
||||||
@@ -2,9 +2,10 @@
|
|||||||
"name": "reacord-docs-new",
|
"name": "reacord-docs-new",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"source": "./src/main.tsx",
|
||||||
"main": "./dist/main.js",
|
"main": "./dist/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup --minify",
|
"build": "esmo --no-warnings scripts/build.ts",
|
||||||
"dev": "esmo --no-warnings scripts/dev.ts | pino-colada",
|
"dev": "esmo --no-warnings scripts/dev.ts | pino-colada",
|
||||||
"start": "NODE_ENV=production pnpm serve | pino-colada",
|
"start": "NODE_ENV=production pnpm serve | pino-colada",
|
||||||
"serve": "node --experimental-import-meta-resolve --experimental-json-modules --no-warnings --enable-source-maps dist/main.js",
|
"serve": "node --experimental-import-meta-resolve --experimental-json-modules --no-warnings --enable-source-maps dist/main.js",
|
||||||
|
|||||||
3
packages/docs/scripts/build.ts
Normal file
3
packages/docs/scripts/build.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import { build } from "esbuild"
|
||||||
|
import { esbuildConfig } from "../esbuild.config"
|
||||||
|
await build(esbuildConfig)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { MenuAlt4Icon } from "@heroicons/react/outline"
|
import { MenuAlt4Icon } from "@heroicons/react/outline/esm"
|
||||||
import clsx from "clsx"
|
import clsx from "clsx"
|
||||||
import React from "react"
|
import React from "react"
|
||||||
import { linkClass } from "../styles/components"
|
import { linkClass } from "../styles/components"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
CodeIcon,
|
CodeIcon,
|
||||||
DocumentTextIcon,
|
DocumentTextIcon,
|
||||||
ExternalLinkIcon,
|
ExternalLinkIcon,
|
||||||
} from "@heroicons/react/solid"
|
} from "@heroicons/react/solid/esm"
|
||||||
import React from "react"
|
import React from "react"
|
||||||
import type { AppLinkProps } from "../components/app-link"
|
import type { AppLinkProps } from "../components/app-link"
|
||||||
import { inlineIconClass } from "../styles/components"
|
import { inlineIconClass } from "../styles/components"
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
import { defineConfig } from "tsup"
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
entry: ["./src/main.tsx"],
|
|
||||||
target: "node16",
|
|
||||||
format: ["esm"],
|
|
||||||
sourcemap: true,
|
|
||||||
})
|
|
||||||
Reference in New Issue
Block a user