@@ -10,7 +10,7 @@ const dev = process.argv.includes("--dev");
10
10
rmSync ( "dist" , { force : true , recursive : true } ) ;
11
11
12
12
const buildOrWatch = async ( options : BuildOptions ) => {
13
- if ( ! dev ) return build ( options ) ;
13
+ if ( ! dev ) return await build ( options ) ;
14
14
const ctx = await context ( options ) ;
15
15
await ctx . watch ( ) ;
16
16
await ctx . rebuild ( ) ;
@@ -19,10 +19,10 @@ const buildOrWatch = async (options: BuildOptions) => {
19
19
await Promise . all ( [
20
20
buildOrWatch ( {
21
21
bundle : true ,
22
- entryPoints : [ "src/index.mts " ] ,
23
- outfile : "dist/index.mjs " ,
22
+ entryPoints : [ "src/index.ts " ] ,
23
+ outfile : "dist/index.js " ,
24
24
platform : "node" ,
25
- target : "node18 " ,
25
+ target : "node20 " ,
26
26
format : "esm" ,
27
27
legalComments : "inline" ,
28
28
external : Object . keys ( packageJSON . peerDependencies ) ,
@@ -33,14 +33,14 @@ await Promise.all([
33
33
outfile : "dist/client.js" ,
34
34
platform : "browser" ,
35
35
format : "esm" ,
36
- target : "safari14 " ,
36
+ target : "safari16 " ,
37
37
legalComments : "inline" ,
38
38
} ) ,
39
39
] ) . then ( ( ) => {
40
- execSync ( "cp LICENSE README.md src/index.cjs dist/" ) ;
40
+ execSync ( "cp LICENSE README.md dist/" ) ;
41
41
42
42
writeFileSync (
43
- "dist/index.d.mts " ,
43
+ "dist/index.d.ts " ,
44
44
`import { PluginOption } from "vite";
45
45
export declare const reactClickToComponent: () => PluginOption;
46
46
` ,
@@ -58,15 +58,8 @@ export declare const reactClickToComponent: () => PluginOption;
58
58
license : packageJSON . license ,
59
59
repository : "github:ArnaudBarre/vite-plugin-react-click-to-component" ,
60
60
type : "module" ,
61
- main : "index.cjs" ,
62
- types : "index.d.mts" ,
63
- module : "index.mjs" ,
64
61
exports : {
65
- "." : {
66
- types : "./index.d.mts" ,
67
- require : "./index.cjs" ,
68
- import : "./index.mjs" ,
69
- } ,
62
+ "." : "./index.js" ,
70
63
} ,
71
64
keywords : [
72
65
"vite" ,
0 commit comments