File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ COPY openclaw.mjs ./
6363COPY ui/package.json ./ui/package.json
6464COPY patches ./patches
6565COPY scripts/postinstall-bundled-plugins.mjs scripts/preinstall-package-manager-warning.mjs scripts/npm-runner.mjs scripts/windows-cmd-helpers.mjs ./scripts/
66+ COPY scripts/lib/package-dist-imports.mjs ./scripts/lib/package-dist-imports.mjs
6667
6768COPY --from=ext-deps /out/ ./${OPENCLAW_BUNDLED_PLUGIN_DIR}/
6869
Original file line number Diff line number Diff line change @@ -74,6 +74,20 @@ describe("Dockerfile", () => {
7474 ) ;
7575 } ) ;
7676
77+ it ( "copies postinstall helper imports before pnpm install" , async ( ) => {
78+ const dockerfile = await readFile ( dockerfilePath , "utf8" ) ;
79+ const installIndex = dockerfile . indexOf ( "pnpm install --frozen-lockfile" ) ;
80+ const postinstallIndex = dockerfile . indexOf ( "COPY scripts/postinstall-bundled-plugins.mjs" ) ;
81+ const distImportHelperIndex = dockerfile . indexOf (
82+ "COPY scripts/lib/package-dist-imports.mjs ./scripts/lib/package-dist-imports.mjs" ,
83+ ) ;
84+
85+ expect ( postinstallIndex ) . toBeGreaterThan ( - 1 ) ;
86+ expect ( distImportHelperIndex ) . toBeGreaterThan ( - 1 ) ;
87+ expect ( postinstallIndex ) . toBeLessThan ( installIndex ) ;
88+ expect ( distImportHelperIndex ) . toBeLessThan ( installIndex ) ;
89+ } ) ;
90+
7791 it ( "prunes runtime dependencies after the build stage" , async ( ) => {
7892 const dockerfile = await readFile ( dockerfilePath , "utf8" ) ;
7993 expect ( dockerfile ) . toContain ( "FROM build AS runtime-assets" ) ;
You can’t perform that action at this time.
0 commit comments