File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/app/src/sandbox/eval Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -670,10 +670,7 @@ export default class TranspiledModule {
670670 return { } ;
671671 }
672672
673- if (
674- this . module . path . startsWith ( '/node_modules' ) &&
675- ! isESModule ( this . module . code )
676- ) {
673+ if ( this . module . path . startsWith ( '/node_modules' ) ) {
677674 if ( process . env . NODE_ENV === 'development' ) {
678675 console . warn (
679676 `[WARN] Sandpack: loading an untranspiled module: ${
@@ -822,6 +819,12 @@ export default class TranspiledModule {
822819 const usedPath = manager . getPresetAliasedPath ( path ) ;
823820 const bfsModule = BrowserFS . BFSRequire ( usedPath ) ;
824821
822+ if ( path === 'os' ) {
823+ const os = require ( 'os-browserify' ) ;
824+ os . homedir = ( ) => '/home/sandbox' ;
825+ return os ;
826+ }
827+
825828 if ( bfsModule ) {
826829 return bfsModule ;
827830 }
You can’t perform that action at this time.
0 commit comments