diff --git a/build-meta.js b/build-meta.js index 433130666..e2c021bea 100644 --- a/build-meta.js +++ b/build-meta.js @@ -3,15 +3,10 @@ const path = require('path'); fs.readdirSync(path.resolve(__dirname, './src/components/')).forEach(folder => { fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => { - if (file ==='package.json') { - fs.copySync(path.resolve(__dirname, './src/components/' + folder) + '/package.json', 'dist/' + folder + '/package.json'); - } - - if (file.endsWith('d.ts')) { + if (file ==='package.json' || file.endsWith('d.ts') || file.endsWith('vue')) { fs.copySync(path.resolve(__dirname, './src/components/' + folder) + '/' + file, 'dist/' + folder + '/' + file); } - }) - + }) }); fs.copySync(path.resolve(__dirname, './package-build.json'), 'dist/package.json'); diff --git a/rollup.config.js b/rollup.config.js index b671a404f..ca4f03a8e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -83,7 +83,7 @@ function addSFC() { fs.readdirSync(path.resolve(__dirname, './src/components/')).forEach(folder => { fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => { let name = file.split(/(.vue)$|(.js)$/)[0].toLowerCase(); - if (/\.vue$/.test(file)) { + if (/\.vue$/.test(file) && (name === folder)) { addEntry(folder, file, name); } });