@jterrazz/typescript 4.0.0 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/ts-build.sh
CHANGED
|
@@ -17,8 +17,14 @@ else
|
|
|
17
17
|
PROJECT_ROOT=$(pwd)
|
|
18
18
|
fi
|
|
19
19
|
|
|
20
|
-
# Get the directory where this script lives (
|
|
21
|
-
|
|
20
|
+
# Get the real directory where this script lives (resolve symlinks)
|
|
21
|
+
SCRIPT_PATH="$0"
|
|
22
|
+
while [ -L "$SCRIPT_PATH" ]; do
|
|
23
|
+
LINK_DIR="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)"
|
|
24
|
+
SCRIPT_PATH="$(readlink "$SCRIPT_PATH")"
|
|
25
|
+
[[ $SCRIPT_PATH != /* ]] && SCRIPT_PATH="$LINK_DIR/$SCRIPT_PATH"
|
|
26
|
+
done
|
|
27
|
+
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)"
|
|
22
28
|
CONFIG_PATH="$SCRIPT_DIR/../config/rolldown.build.config.js"
|
|
23
29
|
|
|
24
30
|
printf "${CYAN_BG}${BRIGHT_WHITE} BUILD ${NC} Building with Rolldown...\n\n"
|
package/bin/ts-dev.sh
CHANGED
|
@@ -17,8 +17,14 @@ else
|
|
|
17
17
|
PROJECT_ROOT=$(pwd)
|
|
18
18
|
fi
|
|
19
19
|
|
|
20
|
-
# Get the directory where this script lives (
|
|
21
|
-
|
|
20
|
+
# Get the real directory where this script lives (resolve symlinks)
|
|
21
|
+
SCRIPT_PATH="$0"
|
|
22
|
+
while [ -L "$SCRIPT_PATH" ]; do
|
|
23
|
+
LINK_DIR="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)"
|
|
24
|
+
SCRIPT_PATH="$(readlink "$SCRIPT_PATH")"
|
|
25
|
+
[[ $SCRIPT_PATH != /* ]] && SCRIPT_PATH="$LINK_DIR/$SCRIPT_PATH"
|
|
26
|
+
done
|
|
27
|
+
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)"
|
|
22
28
|
CONFIG_PATH="$SCRIPT_DIR/../config/rolldown.dev.config.js"
|
|
23
29
|
|
|
24
30
|
printf "${CYAN_BG}${BRIGHT_WHITE} DEV ${NC} Starting watch mode...\n\n"
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { defineConfig } from 'rolldown';
|
|
2
2
|
import { dts } from 'rolldown-plugin-dts';
|
|
3
3
|
|
|
4
|
+
// Externalize all dependencies (node built-ins + node_modules)
|
|
5
|
+
const external = [/node_modules/, /^node:/, /^[a-z@]/];
|
|
6
|
+
|
|
4
7
|
// ESM build with .d.ts generation
|
|
5
8
|
const esmBuild = defineConfig({
|
|
6
9
|
input: './src/index.ts',
|
|
10
|
+
external,
|
|
7
11
|
plugins: [
|
|
8
12
|
dts({
|
|
9
13
|
// Use TypeScript Go for fastest .d.ts generation (experimental)
|
|
@@ -20,6 +24,7 @@ const esmBuild = defineConfig({
|
|
|
20
24
|
// CJS build (no dts - already generated by ESM build)
|
|
21
25
|
const cjsBuild = defineConfig({
|
|
22
26
|
input: './src/index.ts',
|
|
27
|
+
external,
|
|
23
28
|
output: {
|
|
24
29
|
file: 'dist/index.cjs',
|
|
25
30
|
format: 'cjs',
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { defineConfig } from 'rolldown';
|
|
2
2
|
|
|
3
3
|
// Dev build - ESM only, no .d.ts (faster rebuilds)
|
|
4
|
+
// Externalize all dependencies for Node.js apps
|
|
4
5
|
export default defineConfig({
|
|
5
6
|
input: './src/index.ts',
|
|
7
|
+
external: [/node_modules/, /^node:/, /^[a-z@]/],
|
|
6
8
|
output: {
|
|
7
9
|
dir: 'dist',
|
|
8
10
|
format: 'esm',
|