Skip to content

Commit 6b1dd9c

Browse files
committed
Update build scripts to remove package.json and set module type in package.json for improved dependency management.
1 parent 5291410 commit 6b1dd9c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.github/workflows/build-and-release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ jobs:
6666
cp package.json output/${PLATFORM}/
6767
cd output/${PLATFORM}
6868
npm install --production --no-optional
69-
rm package.json package-lock.json
69+
rm package-lock.json
70+
echo '{"type":"module"}' > package.json
7071
7172
# Prune unnecessary files from node_modules
7273
find node_modules -type d -name "test" -exec rm -rf {} + 2>/dev/null || true
@@ -167,7 +168,8 @@ jobs:
167168
cp package.json output/${PLATFORM}/
168169
cd output/${PLATFORM}
169170
npm install --production --no-optional
170-
rm package.json package-lock.json
171+
rm package-lock.json
172+
echo '{"type":"module"}' > package.json
171173
172174
# Prune unnecessary files from node_modules
173175
find node_modules -type d -name "test" -exec rm -rf {} + 2>/dev/null || true
@@ -264,7 +266,8 @@ jobs:
264266
cp package.json output/${PLATFORM}/
265267
cd output/${PLATFORM}
266268
npm install --production --no-optional
267-
rm package.json package-lock.json
269+
rm package-lock.json
270+
echo '{"type":"module"}' > package.json
268271
269272
# Prune unnecessary files from node_modules
270273
find node_modules -type d -name "test" -exec rm -rf {} + 2>/dev/null || true

build-all.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ build_platform() {
133133
cp package.json output/${platform}/
134134
cd output/${platform}
135135
npm install --production --no-optional --silent
136-
rm package.json package-lock.json
136+
rm package-lock.json
137+
echo '{"type":"module"}' > package.json
137138
echo "✓ Installed dependencies"
138139

139140
# Step 5: Prune unnecessary files from node_modules

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ echo "━━━━━━━━━━━━━━━━━━━━━━━━
100100
cp package.json output/${PLATFORM}/
101101
cd output/${PLATFORM}
102102
npm install --production --no-optional
103-
rm package.json package-lock.json
103+
rm package-lock.json
104+
echo '{"type":"module"}' > package.json
104105
echo "✓ Installed production dependencies"
105106
echo ""
106107

0 commit comments

Comments
 (0)