Refactor on build to avoid compilling unncessary SFCs and copy all SFCs to dist

This commit is contained in:
Cagatay Civici 2021-01-18 18:38:34 +03:00
parent 38fccede63
commit 05327ee35e
2 changed files with 3 additions and 8 deletions

View file

@ -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);
}
});