@u-devtools/core 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("vite"),d=require("@vitejs/plugin-vue"),x=require("vite-plugin-dts"),n=require("node:path"),f=require("node:fs");function T(r){return{name:"clean-timestamp-files",buildStart(){try{f.readdirSync(r).forEach(t=>{if(t.includes(".timestamp-")&&t.endsWith(".mjs"))try{f.unlinkSync(n.join(r,t))}catch{}})}catch{}}}}function E({entry:r,name:u,dir:t,external:c=[],clearScreen:p=!1,useVue:l=!0,formats:m=["es","cjs"],fileName:j,dtsOptions:i={},additionalPlugins:v=[],resolveAlias:a,cssCodeSplit:y}){const o=[];l&&o.push(d()),o.push(x({rollupTypes:i.rollupTypes??!(i.insertTypesEntry??!1),insertTypesEntry:i.insertTypesEntry??!1,exclude:i.exclude,copyDtsFiles:i.copyDtsFiles,tsconfigPath:n.resolve(t,"tsconfig.json"),outDir:n.resolve(t,"dist"),compilerOptions:{removeComments:!1}})),o.push(T(t)),o.push(...v);const h=typeof r=="string"?n.resolve(t,r):Object.fromEntries(Object.entries(r).map(([e,s])=>[e,n.resolve(t,s)])),b=(e,s)=>s&&s!=="index"?`${s}.${e==="es"?"
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("vite"),d=require("@vitejs/plugin-vue"),x=require("vite-plugin-dts"),n=require("node:path"),f=require("node:fs");function T(r){return{name:"clean-timestamp-files",buildStart(){try{f.readdirSync(r).forEach(t=>{if(t.includes(".timestamp-")&&t.endsWith(".mjs"))try{f.unlinkSync(n.join(r,t))}catch{}})}catch{}}}}function E({entry:r,name:u,dir:t,external:c=[],clearScreen:p=!1,useVue:l=!0,formats:m=["es","cjs"],fileName:j,dtsOptions:i={},additionalPlugins:v=[],resolveAlias:a,cssCodeSplit:y}){const o=[];l&&o.push(d()),o.push(x({rollupTypes:i.rollupTypes??!(i.insertTypesEntry??!1),insertTypesEntry:i.insertTypesEntry??!1,exclude:i.exclude,copyDtsFiles:i.copyDtsFiles,tsconfigPath:n.resolve(t,"tsconfig.json"),outDir:n.resolve(t,"dist"),compilerOptions:{removeComments:!1}})),o.push(T(t)),o.push(...v);const h=typeof r=="string"?n.resolve(t,r):Object.fromEntries(Object.entries(r).map(([e,s])=>[e,n.resolve(t,s)])),b=(e,s)=>s&&s!=="index"?`${s}.${e==="es"?"es":"cjs"}.js`:`index.${e==="es"?"es":"cjs"}.js`;return g.defineConfig({clearScreen:p,plugins:o,define:{"import.meta.hot":"import.meta.hot"},resolve:{extensions:[".mjs",".js",".mts",".ts",".jsx",".tsx",".json",".vue"],...a?{alias:Object.fromEntries(Object.entries(a).map(([e,s])=>[e,n.resolve(t,s)]))}:{}},build:{lib:{entry:h,name:u,fileName:j??b,formats:m},cssCodeSplit:y,rollupOptions:{external:e=>!!(e==="vite"||l&&e==="vue"||e.startsWith("@u-devtools/")||e.startsWith("node:")||c.includes(e)),output:{globals:l?{vue:"Vue"}:{}}}}})}exports.createViteConfig=E;
|
|
@@ -49,7 +49,7 @@ function O({
|
|
|
49
49
|
}
|
|
50
50
|
})
|
|
51
51
|
), i.push(F(t)), i.push(...j);
|
|
52
|
-
const y = typeof r == "string" ? o(t, r) : Object.fromEntries(Object.entries(r).map(([e, s]) => [e, o(t, s)])), v = (e, s) => s && s !== "index" ? `${s}.${e === "es" ? "
|
|
52
|
+
const y = typeof r == "string" ? o(t, r) : Object.fromEntries(Object.entries(r).map(([e, s]) => [e, o(t, s)])), v = (e, s) => s && s !== "index" ? `${s}.${e === "es" ? "es" : "cjs"}.js` : `index.${e === "es" ? "es" : "cjs"}.js`;
|
|
53
53
|
return x({
|
|
54
54
|
clearScreen: m,
|
|
55
55
|
plugins: i,
|
package/package.json
CHANGED
package/vite/vite.config.base.ts
CHANGED
|
@@ -128,7 +128,7 @@ export function createViteConfig({
|
|
|
128
128
|
|
|
129
129
|
const defaultFileName = (format: string, entryName?: string) => {
|
|
130
130
|
if (entryName && entryName !== 'index') {
|
|
131
|
-
return `${entryName}.${format === 'es' ? '
|
|
131
|
+
return `${entryName}.${format === 'es' ? 'es' : 'cjs'}.js`;
|
|
132
132
|
}
|
|
133
133
|
return `index.${format === 'es' ? 'es' : 'cjs'}.js`;
|
|
134
134
|
};
|