File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @compiled/vite-plugin ' : patch
3+ ---
4+
5+ Split CJS and ESM exports for the Vite Plugin
Original file line number Diff line number Diff line change 11{
22 "files" : [],
3- "references" : [{ "path" : " react/tsconfig.json" }]
3+ "references" : [{ "path" : " react/tsconfig.json" }, { "path" : " vite-plugin/tsconfig.json " } ]
44}
Original file line number Diff line number Diff line change 1313 { "path" : " parcel-transformer-external/tsconfig.json" },
1414 { "path" : " react/tsconfig.cjs.json" },
1515 { "path" : " utils/tsconfig.json" },
16- { "path" : " vite-plugin/tsconfig.json" },
16+ { "path" : " vite-plugin/tsconfig.cjs. json" },
1717 { "path" : " webpack-loader/tsconfig.json" }
1818 ]
1919}
Original file line number Diff line number Diff line change 1414 "sideEffects" : false ,
1515 "exports" : {
1616 "." : {
17- "types" : " ./dist/index.d.ts" ,
18- "import" : " ./dist/index.js" ,
19- "require" : " ./dist/index.js" ,
20- "default" : " ./dist/index.js"
17+ "types" : " ./dist/esm/index.d.ts" ,
18+ "import" : " ./dist/esm/index.js" ,
19+ "require" : " ./dist/cjs/index.js"
2120 }
2221 },
23- "main" : " ./dist/index.js" ,
24- "module" : " ./dist/index.js" ,
25- "types" : " ./dist/index.d.ts" ,
22+ "main" : " ./dist/cjs/ index.js" ,
23+ "module" : " ./dist/esm/ index.js" ,
24+ "types" : " ./dist/esm/ index.d.ts" ,
2625 "files" : [
2726 " dist" ,
2827 " src"
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import { createDefaultResolver } from './utils';
1919 * @param userOptions - Plugin configuration options
2020 * @returns Vite plugin object
2121 */
22- export default function compiledVitePlugin ( userOptions : PluginOptions = { } ) : any {
22+ function compiled ( userOptions : PluginOptions = { } ) : any {
2323 const options : PluginOptions = {
2424 // Vite-specific
2525 bake : true ,
@@ -273,4 +273,6 @@ export default function compiledVitePlugin(userOptions: PluginOptions = {}): any
273273 } ;
274274}
275275
276+ export { compiled } ;
276277export type { PluginOptions as VitePluginOptions } ;
278+ export default compiled ;
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ../tsconfig.options.json" ,
3+ "compilerOptions" : {
4+ "rootDir" : " ./src" ,
5+ "outDir" : " ./dist/cjs" ,
6+ "skipLibCheck" : true ,
7+ "tsBuildInfoFile" : " tsconfig.cjs.tsbuildinfo"
8+ },
9+ "include" : [" ./src/**/*" ],
10+ "exclude" : [" ./src/__tests__/**/*" ],
11+ "references" : [
12+ { "path" : " ../babel-plugin/tsconfig.json" },
13+ { "path" : " ../babel-plugin-strip-runtime/tsconfig.json" },
14+ { "path" : " ../css/tsconfig.json" },
15+ { "path" : " ../utils/tsconfig.json" }
16+ ]
17+ }
Original file line number Diff line number Diff line change 22 "extends" : " ../tsconfig.options.json" ,
33 "compilerOptions" : {
44 "rootDir" : " ./src" ,
5- "outDir" : " ./dist" ,
6- "skipLibCheck" : true
5+ "outDir" : " ./dist/esm" ,
6+ "module" : " es6" ,
7+ "moduleResolution" : " node" ,
8+ "skipLibCheck" : true ,
9+ "tsBuildInfoFile" : " tsconfig.esm.tsbuildinfo"
710 },
811 "include" : [" ./src/**/*" ],
912 "exclude" : [" ./src/__tests__/**/*" ],
You can’t perform that action at this time.
0 commit comments