## Summary Reverts two commits that broke CJS package handling in dev mode: - Reverts #3793 (CJS detection regex fix) - Reverts #3767 (removal of Babel CJS→ESM transform) The simplified CJS shim introduced in #3767 has two fundamental issues: 1. **Detection**: the heuristic (`code.includes("export ")`) is fooled by comments containing "export" 2. **Named exports**: the shim only provides `export default module.exports`, so `import { trace } from "@opentelemetry/api"` returns `undefined` (#3797) The Babel-based transform handled both correctly. Bringing it back until we can replace it with a proper solution using `deno_ast`'s CJS parser.
Fresh vite plugin
Vite plugin for Fresh.
Usage
- Run
deno install jsr:@fresh/plugin-vite npm:vite - Ensure that your
deno.jsonhas thefreshimport mapping:
{
"imports": {
"fresh": "jsr:@fresh/core"
}
}
- Update your
vite.config.tsfile:
import { defineConfig } from "vite";
+ import { fresh } from "@fresh/plugin-vite";
export default defineConfig({
plugins: [
+ fresh(),
],
});
- Update your deno tasks respectively:
- Dev:
vite - Build:
vite build
More information on the Fresh documentation .