Skip to content

Commit

Permalink
add php-wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
hatemhosny committed Oct 9, 2023
1 parent 9939036 commit 12eaf09
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 3 deletions.
9 changes: 9 additions & 0 deletions dist/php-wasm/php-wasm.js

Large diffs are not rendered by default.

Binary file added dist/php-wasm/php-web.wasm
Binary file not shown.
10 changes: 8 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@live-codes/browser-compilers",
"version": "0.8.0",
"version": "0.9.0",
"description": "Compilers that run in the browser, for use in livecodes.io",
"author": "Hatem Hosny",
"license": "MIT",
Expand Down Expand Up @@ -63,6 +63,7 @@
"less": "4.1.3",
"lightningcss-wasm": "1.21.0",
"patch-package": "6.4.7",
"php-wasm": "0.0.7",
"postcss": "8.4.24",
"postcss-modules": "6.0.0",
"postcss-preset-env": "8.4.2",
Expand Down
15 changes: 15 additions & 0 deletions scripts/vendors.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,3 +477,18 @@ esbuild.build({
outfile: 'dist/vue-compiler-sfc/vue-compiler-sfc.js',
globalName: 'VueCompilerSFC',
});

// php-wasm
esbuild
.build({
...baseOptions,
entryPoints: ['vendor_modules/imports/php-wasm.js'],
outfile: 'dist/php-wasm/php-wasm.js',
globalName: 'phpWasm',
})
.then(() => {
fs.copyFileSync(
path.resolve('node_modules/php-wasm/php-web.wasm'),
path.resolve(targetDir + '/php-wasm/php-web.wasm'),
);
});
2 changes: 2 additions & 0 deletions vendor_modules/imports/php-wasm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { PhpWeb as PHP } from 'php-wasm/PhpWeb';
export { PHP };

0 comments on commit 12eaf09

Please sign in to comment.