| Repository | Link |
|---|---|
binaryen-loader | https://github.com/DrSensor/binaryen-loader |
| Example Project | https://github.com/DrSensor/example-vue-component-rust |
Binaryen is a compiler and toolchain infrastructure library for WebAssembly, written in C++. Most of the tools are cli app and one of them can be embedded into javascript (binaryen.js). This project is just a webpack loader that wraps binaryen.js (only the optimization parts) so it can be chained easily with other webpack-loader. For more insight see this tutorial in section Using Binaryen.
binaryen-loader with other webpack loaderSince this project based on binaryen.js, most of the features are just wrappers from module-optimization section. Some of the features are:
options.optimizationoptions.transformation.passes (sometimes it can shrink the bundle size, sometimes it can increase the execution speed, sometimes it does the opposites for both of them)options.debug to trueSince this project generated from webpack-defaults with some modification (see commit before v0.0.2), the tech stack used is what webpack-defaults proposed.
| Task | Tech/Tool | Configuration |
|---|---|---|
| Package Manager | npm (not yarn) | package.json |
| Test Framework | Jest | jest.config.js, jest.setup.js |
| Linter and others | ESLint, Prettier, husky | .prettierrc, .eslintrc.js, lint-staged, commitlint.config.js |
| Release Tool | husky, standard-version | |
| Build Tool (Transpiler) | Babel | .babelrc |
| CI | circleci | .circleci/config.yml |
expect(err).toThrowErrorMatchingSnapshot() can make the test fail if runned on nodejs v10 or newer..toThrowErrorMatchingSnapshot(). Left: generated when running on node:10. Right: generated when running on node:8 and node:6--ci flag or set testEnvironment: 'node' (since by default testEnvironment is jsdom). Maybe adding jest.config.js override jest configuration in package.json (making it invalid).passes like print-call-graph that is print the call-graph to stdout will pollute webpack outputted message. I plan to pipe the output into a file but still don't have a clue how to do it. Feel free to make PR, open an Issue, or just comment below if anyone has an idea 🙂rust-native-wasm-loader).The project is open to contributions in any way possible. If you find a bug, please open an issue in the project's issue tracker. For submitting code patches, feel free to open pull requests on Github. Read CONTRIBUTING.md first for the best experience 😄