Skip to content

Commit 195248b

Browse files
Do not externalize required deps
1 parent 696e5f7 commit 195248b

4 files changed

Lines changed: 6 additions & 29 deletions

File tree

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,7 @@
217217
"ignoreDependencies": [
218218
"@ast-grep/napi",
219219
"@shopify/theme-check-docs-updater",
220-
"@shopify/theme-check-node",
221-
"prettier",
222-
"ts-morph"
220+
"@shopify/theme-check-node"
223221
],
224222
"vite": {
225223
"config": [

packages/cli/bin/bundle.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,8 @@ const external = [
1919
// esbuild can't be bundled per design
2020
'esbuild',
2121
'lightningcss',
22-
// Binary dependencies from Hydrogen that can't be bundled
22+
// These two are binary dependencies from Hydrogen that can't be bundled
2323
'@ast-grep/napi',
24-
// prettier is ~4MB and only used for formatting generated types.
25-
// Lazily loaded via dynamic import, safe to externalize.
26-
'prettier',
27-
// ts-morph + typescript are ~19MB. Used by Hydrogen for JS/TS transpilation.
28-
// Already lazily loaded via dynamic import, safe to externalize.
29-
'ts-morph',
30-
// typescript compiler (~9MB) is pulled in by ts-morph and json-schema-to-typescript.
31-
// Available at runtime as a project dependency.
32-
'typescript',
3324
]
3425

3526
// yoga wasm file is not bundled by esbuild, so we need to copy it manually
@@ -49,7 +40,7 @@ const hydrogenAssets = joinPath(hydrogenPath, 'dist/assets/hydrogen/**/*')
4940

5041
esBuild({
5142
bundle: true,
52-
entryPoints: (await glob('./src/**/*.ts')).filter(f => !f.includes('.test.')),
43+
entryPoints: ['./src/index.ts'],
5344
outdir: './dist',
5445
platform: 'node',
5546
format: 'esm',
@@ -62,7 +53,7 @@ esBuild({
6253
},
6354
inject: ['../../bin/bundling/cjs-shims.js'],
6455
external,
65-
sourcemap: 'external',
56+
sourcemap: true,
6657
loader: {'.node': 'copy'},
6758
splitting: true,
6859
// these tree shaking and minify options remove any in-source tests from the bundle

packages/cli/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,18 @@
5454
"dependencies": {
5555
"@ast-grep/napi": "0.33.0",
5656
"esbuild": "0.27.3",
57-
"global-agent": "3.0.0",
58-
"prettier": "3.8.1",
59-
"ts-morph": "17.0.1",
60-
"typescript": "5.9.3"
57+
"global-agent": "3.0.0"
6158
},
6259
"devDependencies": {
6360
"@oclif/core": "4.5.3",
6461
"@oclif/plugin-commands": "4.1.33",
6562
"@oclif/plugin-plugins": "5.4.47",
6663
"@shopify/app": "3.92.0",
6764
"@shopify/cli-kit": "3.92.0",
68-
"@shopify/cli-hydrogen": "11.1.10",
6965
"@shopify/plugin-cloudflare": "3.92.0",
7066
"@shopify/plugin-did-you-mean": "3.92.0",
7167
"@shopify/theme": "3.92.0",
68+
"@shopify/cli-hydrogen": "11.1.10",
7269
"@types/global-agent": "3.0.0",
7370
"@vitest/coverage-istanbul": "^3.1.4",
7471
"esbuild-plugin-copy": "^2.1.1"

pnpm-lock.yaml

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)