cashscript
cashscript copied to clipboard
Allow for config-free usage in browser (e.g. Next.js)
Right now, this is what a Next.js config file has to look like for CashScript to work with it:
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
webpack: (config, options) => {
config.experiments = {...config.experiments, topLevelAwait: true };
config.resolve.alias = {...config.resolve.alias, ...{
net: false,
tls: false,
fs: false,
}};
return config
},
}
module.exports = nextConfig
Ideally we don't require any of this config. So we'll have to find a solution to the fact that CashScript and its dependencies require these Node.js specific modules. @mr-zwets mentioned that @mainnet-pat is also familiar with these issues of trying to run CashScript / electrum-cash in the browser, so maybe he'll have some ideas as well.