fix: remove lib config

This commit is contained in:
julien huang 2023-08-29 21:08:03 +02:00
parent d553fd0e76
commit ee279635ba

View File

@ -152,12 +152,7 @@ export const componentsChunkPlugin = createUnplugin((options: ComponentChunkOpti
config.build.rollupOptions = config.build.rollupOptions || {} config.build.rollupOptions = config.build.rollupOptions || {}
config.build.rollupOptions.output = config.build.rollupOptions.output || {} config.build.rollupOptions.output = config.build.rollupOptions.output || {}
config.build.rollupOptions.input = config.build.rollupOptions.input || {} config.build.rollupOptions.input = config.build.rollupOptions.input || {}
config.build.lib = {
entry: {},
formats: ['es'],
fileName: '[name].mjs',
name: 'components'
}
for (const component of components) { for (const component of components) {
if (component.mode === 'client' || component.mode === 'all') { if (component.mode === 'client' || component.mode === 'all') {
// (config.build.lib.entry as Record<string, string>)[component.pascalName] = await resolvePath(component.filePath) // (config.build.lib.entry as Record<string, string>)[component.pascalName] = await resolvePath(component.filePath)
@ -188,7 +183,6 @@ export const componentsChunkPlugin = createUnplugin((options: ComponentChunkOpti
for (const component of components) { for (const component of components) {
if (chunkInfo.facadeModuleId) { if (chunkInfo.facadeModuleId) {
const { pathname } = parseURL(decodeURIComponent(pathToFileURL(chunkInfo.facadeModuleId).href)) const { pathname } = parseURL(decodeURIComponent(pathToFileURL(chunkInfo.facadeModuleId).href))
const isPath = await resolvePath(component.filePath) === pathname const isPath = await resolvePath(component.filePath) === pathname
if (isPath) { if (isPath) {
chunkInfo.isEntry = false chunkInfo.isEntry = false