File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export function MimeIsland() {
55 const [ ready , setReady ] = useState ( false ) ;
66 useEffect ( ( ) => {
77 // deno-lint-ignore no-console
8- console . log ( mime . default ) ;
8+ console . log ( mime ) ;
99 setReady ( true ) ;
1010 } , [ ] ) ;
1111
Original file line number Diff line number Diff line change @@ -38,16 +38,27 @@ export function fresh(config?: FreshViteConfig): Plugin[] {
3838 "react-dom" : "preact/compat" ,
3939 react : "preact/compat" ,
4040 } ,
41+ dedupe : [
42+ "preact" ,
43+ "preact/hooks" ,
44+ "preact/jsx-runtime" ,
45+ "preact/jsx-dev-runtime" ,
46+ "preact/compat" ,
47+ "@preact/signals" ,
48+ "@preact/signals-core" ,
49+ ] ,
4150 } ,
4251 optimizeDeps : {
43- include : [
52+ exclude : [
4453 "preact" ,
4554 "preact/hooks" ,
4655 "preact/jsx-runtime" ,
4756 "preact/jsx-dev-runtime" ,
4857 "preact/compat" ,
4958 "@preact/signals" ,
59+ "@preact/signals-core" ,
5060 ] ,
61+ noDiscovery : true ,
5162 } ,
5263
5364 publicDir : pathWithRoot ( "static" , config . root ) ,
Original file line number Diff line number Diff line change @@ -20,18 +20,18 @@ export function deno(): Plugin {
2020
2121 let isDev = false ;
2222
23- let optimizeDeps : string [ ] | undefined ;
24-
2523 return {
2624 name : "deno" ,
2725 config ( _ , env ) {
2826 isDev = env . command === "serve" ;
2927 } ,
30- async configResolved ( cfg ) {
31- optimizeDeps = cfg . optimizeDeps . include ;
28+ async configResolved ( ) {
3229 // TODO: Pass conditions
3330 ssrLoader = await new Workspace ( { } ) . createLoader ( ) ;
34- browserLoader = await new Workspace ( { preserveJsx : true } )
31+ browserLoader = await new Workspace ( {
32+ platform : "browser" ,
33+ preserveJsx : true ,
34+ } )
3535 . createLoader ( ) ;
3636 } ,
3737 applyToEnvironment ( ) {
@@ -50,18 +50,6 @@ export function deno(): Plugin {
5050 ? parseDenoSpecifier ( importer ) . specifier
5151 : importer ;
5252
53- if ( optimizeDeps ) {
54- const match = id . match ( / ^ n p m : ( @ [ ^ / ] + \/ [ ^ / @ ] + | [ ^ / @ ] + ) / ) ;
55- if ( match !== null ) {
56- if ( optimizeDeps . includes ( match [ 1 ] ) ) {
57- return await this . resolve ( match [ 1 ] , importer , options ) ;
58- }
59- }
60- }
61- if ( id . includes ( "@preact/signals" ) ) {
62- return this . resolve ( `@preact/signals` , importer , options ) ;
63- }
64-
6553 try {
6654 // Ensure we're passing a valid importer that Deno understands
6755 const denoImporter = importer && ! importer . startsWith ( "\0" )
You can’t perform that action at this time.
0 commit comments