Install Mesh into your existing project
If you are looking to use Mesh into your existing project, you can choose the stack and configure them.
Next.js
1. Install MeshJS package
Install the latest version of Mesh with npm:
npm install @meshsdk/core @meshsdk/react
2. Add webpack in next.config.js
Open next.config.js and append webpack configurations. Your next.config.js should look like this:
/** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, webpack: function (config, options) { config.experiments = { asyncWebAssembly: true, }; return config; }, }; module.exports = nextConfig;
NestJS
1. Install MeshJS package
Install the latest version of Mesh with npm:
npm install @meshsdk/core
That's all. Start building.
Gatsby
1. Install MeshJs package
Install the latest version of Mesh with npm:
npm install @meshsdk/core @meshsdk/react
2. Add webpack in gatsby-node.js
Open gatsby-node.js and append webpack configurations. Your gatsby-node.js should look like this:
exports.onCreateWebpackConfig = ({ actions }) => { actions.setWebpackConfig({ experiments: { syncWebAssembly: true, }, resolve: { fallback: { stream: false, }, }, }); };
Webpack
1. Install Buffer and Stream package
npm install buffer stream
2. Install MeshJS package
Install the latest version of Mesh with npm:
npm install @meshsdk/core
3. Update webpack.config.cjs
Change your webpack.config.cjs and provide the following configurations. Your webpack.config.cjs should look like this:
const path = require("path"); const webpack = require('webpack'); module.exports = { resolve: { fallback: { buffer: require.resolve("buffer"), stream: require.resolve("stream"), }, }, plugins: [ new webpack.ProvidePlugin({ Buffer: ["buffer", "Buffer"], }), ], experiments: { asyncWebAssembly: true, }, };