@@ -10,7 +10,7 @@ const dev = process.argv.includes("--dev");
1010rmSync ( "dist" , { force : true , recursive : true } ) ;
1111
1212const buildOrWatch = async ( options : BuildOptions ) => {
13- if ( ! dev ) return build ( options ) ;
13+ if ( ! dev ) return await build ( options ) ;
1414 const ctx = await context ( options ) ;
1515 await ctx . watch ( ) ;
1616 await ctx . rebuild ( ) ;
@@ -19,10 +19,10 @@ const buildOrWatch = async (options: BuildOptions) => {
1919await Promise . all ( [
2020 buildOrWatch ( {
2121 bundle : true ,
22- entryPoints : [ "src/index.mts " ] ,
23- outfile : "dist/index.mjs " ,
22+ entryPoints : [ "src/index.ts " ] ,
23+ outfile : "dist/index.js " ,
2424 platform : "node" ,
25- target : "node18 " ,
25+ target : "node20 " ,
2626 format : "esm" ,
2727 legalComments : "inline" ,
2828 external : Object . keys ( packageJSON . peerDependencies ) ,
@@ -33,14 +33,14 @@ await Promise.all([
3333 outfile : "dist/client.js" ,
3434 platform : "browser" ,
3535 format : "esm" ,
36- target : "safari14 " ,
36+ target : "safari16 " ,
3737 legalComments : "inline" ,
3838 } ) ,
3939] ) . then ( ( ) => {
40- execSync ( "cp LICENSE README.md src/index.cjs dist/" ) ;
40+ execSync ( "cp LICENSE README.md dist/" ) ;
4141
4242 writeFileSync (
43- "dist/index.d.mts " ,
43+ "dist/index.d.ts " ,
4444 `import { PluginOption } from "vite";
4545export declare const reactClickToComponent: () => PluginOption;
4646` ,
@@ -58,15 +58,8 @@ export declare const reactClickToComponent: () => PluginOption;
5858 license : packageJSON . license ,
5959 repository : "github:ArnaudBarre/vite-plugin-react-click-to-component" ,
6060 type : "module" ,
61- main : "index.cjs" ,
62- types : "index.d.mts" ,
63- module : "index.mjs" ,
6461 exports : {
65- "." : {
66- types : "./index.d.mts" ,
67- require : "./index.cjs" ,
68- import : "./index.mjs" ,
69- } ,
62+ "." : "./index.js" ,
7063 } ,
7164 keywords : [
7265 "vite" ,
0 commit comments