Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2654 - Improve WASM loading performance #4893

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions example/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
const webpack = require('webpack');
const HtmlReplaceWebpackPlugin = require('html-replace-webpack-plugin');
const GitRevisionPlugin = require('git-revision-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');

const gitRevisionPlugin = new GitRevisionPlugin();
const applicationVersion = gitRevisionPlugin.version().split('-')[0];
Expand Down Expand Up @@ -35,6 +36,16 @@ module.exports = override(
},
]),
),
addWebpackPlugin(
new CopyPlugin({
patterns: [
{
from: '../node_modules/ketcher-standalone/**/*.wasm',
to: '[name][ext]',
},
],
}),
),
);

module.exports.envVariables = envVariables;
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@types/react-dom": "^18.0.8",
"@vitejs/plugin-react": "^4.0.0",
"@welldone-software/why-did-you-render": "^4.3.1",
"copy-webpack-plugin": "^12.0.2",
"cross-env": "^7.0.3",
"customize-cra": "^1.0.0",
"eslint": "^8.44.0",
Expand Down
198 changes: 192 additions & 6 deletions package-lock.json

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

19 changes: 15 additions & 4 deletions packages/ketcher-standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"node": ">=14"
},
"scripts": {
"build": "cross-env NODE_ENV=production rollup -c -m true",
"build": "cross-env NODE_ENV=production rollup -c -m true && cross-env NODE_ENV=production BINARY_WASM=true rollup -c -m true",
"start": "cross-env NODE_ENV=development rollup -c -m true -w",
"test": "run-s test:prettier test:eslint:quiet test:types test:unit",
"test:eslint": "eslint . --ext .ts,.js",
Expand All @@ -42,17 +42,18 @@
},
"dependencies": {
"@babel/runtime": "^7.17.9",
"indigo-ketcher": "1.21.0-rc.1",
"indigo-ketcher": "1.22.0-dev.2",
"ketcher-core": "*"
},
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-node-resolve": "^10.0.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-strip": "^2.0.0",
"@types/jest": "^27.0.3",
"@types/node": "^16.11.12",
Expand All @@ -74,5 +75,15 @@
},
"files": [
"dist"
]
],
"exports": {
".": {
"import": "./dist/index.modern.js",
"require": "./dist/index.js"
},
"./dist/binaryWasm": {
"import": "./dist/binaryWasm/index.modern.js",
"require": "./dist/binaryWasm/index.js"
}
}
}
Loading
Loading