Open markskayff opened 2 weeks ago
The browser does not provide packages such as os
, so these packages are not available when building for the browser. If you want to substitute them for other ones, you should be able to use either the alias feature or a plugin for that.
That plugin (and most esbuild plugins) are meant to run in the Node.js runtime. While your error message seems that you're bundling that plugin into your browser bundle, which is incorrect.
That plugin (and most esbuild plugins) are meant to run in the Node.js runtime. While your error message seems that you're bundling that plugin into your browser bundle, which is incorrect.
Definitely I'm building for the browser here. But the odd part is this, it's a project I'm resuming from 1 year, which it was working ok, and now trying to re-build it, and it's complaining with this. That's odd.
When trying to build a react project doing:
npm run build-dev
I get a lot of Could not resolve "path" Could not resolve "os" Could not resolve "crypto"And of course the build fails. I'm building for the browser.
I have to note I'm using this plugin:
const envFilePlugin = require('esbuild-envfile-plugin');