fix vscode-extension bundle step adding correct jspi subfolder#359
fix vscode-extension bundle step adding correct jspi subfolder#359
Conversation
|
After upgrading the playground dependencies, the bundle steps for In this PR I'm fixing the
It seems it was modified in this commit: @adamziel , do you know if it's a fail in the import or in the "build" process? So I'm wondering if we need to change the build process on the Playground repo to avoid having that php folder there. |
|
@adamziel Absolutely, I'd be happy to look into it. On it. |
|
I created a fix for the issue at WordPress/wordpress-playground#1958 |
…ge (#1958) @sejas has [brought to our attention](WordPress/playground-tools#359 (comment)) that the imports of the wasm assets are using incorrect paths, since 3bebb24. The [source](https://github.com/WordPress/wordpress-playground/blob/trunk/packages/php-wasm/web/src/lib/get-php-loader-module.ts#L22) says something like: ```ts return await import('../../public/php/jspi/php_8_3.js'); ``` Which currently results in the built file saying: ```js return await import("./jspi/php_8_3.js"); ``` However, since the tree of the published package is as follows, the path in the built file is missing a leading `/php`. ``` php ├── asyncify │ └── php_8_3.js └── jspi └── php_8_3.js ``` This PR fixes the issue by making it so that the imports have a leading `/php`, which results in the import being: ```js return await import("./php/jspi/php_8_3.js"); ``` ## Testing instructions Build the package: ```shell npx nx run php-wasm-web:build ``` Then make sure that the paths in `dist/packages/php-wasm/web/index.js` (around line 95) are correct, i.e. `./php/jspi/php_8_3.js`.

What?
It updates the correct path of
jspi/PHP_*to be included in the VS Code extension after upgrading the Playground dependencies on #350Why?
The paths to wasm files have changed in the new version.
How?
Updating the project bundle step.
Testing Instructions
npx nx run vscode-extension:build:bundle> NX Successfully ran target build:bundle for project vscode-extension (501ms)