Use dynamic import()
without webpack finding out.
npm install --save import-fool-webpack
import importFoolWebpack from 'import-fool-webpack';
const os = await importFoolWebpack ( 'node:os' ); // It's just like "import ( 'node:os' )";
console.log ( os.platform () ); // => 'darwin'
MIT © Fabio Spampinato