diff --git a/packages/repl/src/lib/workers/bundler/index.ts b/packages/repl/src/lib/workers/bundler/index.ts index 6e84324a03..115f4eeed3 100644 --- a/packages/repl/src/lib/workers/bundler/index.ts +++ b/packages/repl/src/lib/workers/bundler/index.ts @@ -443,7 +443,8 @@ async function get_bundle( glsl, loop_protect, replace({ - 'process.env.NODE_ENV': JSON.stringify('production') + 'process.env.NODE_ENV': JSON.stringify('production'), + 'import.meta.env.MODE': JSON.stringify('development') }), { name: 'css', diff --git a/packages/repl/src/lib/workers/npm.ts b/packages/repl/src/lib/workers/npm.ts index 57710a3daa..10abe6f312 100644 --- a/packages/repl/src/lib/workers/npm.ts +++ b/packages/repl/src/lib/workers/npm.ts @@ -199,7 +199,10 @@ export function resolve_subpath(pkg: Package, subpath: string): string { } export function normalize_path(pkg: Package, path: string, importee: string, importer: string) { - for (const suffix of ['', '.js', '.mjs', '.cjs', '/index.js', '/index.mjs', '/index.cjs']) { + const suffixes = path.endsWith('/') + ? ['index.js', 'index.mjs', 'index.cjs'] + : ['', '.js', '.mjs', '.cjs', '/index.js', '/index.mjs', '/index.cjs']; + for (const suffix of suffixes) { let with_suffix = path + suffix; if (pkg.meta.browser) {