DataView import refactor

pull/12/head
cagataycivici 2019-05-25 19:03:57 +03:00
parent dcdf70ac66
commit be012e97a2
3 changed files with 11 additions and 1 deletions

View File

@ -7,9 +7,19 @@ fs.readdirSync(path.resolve(__dirname, './src/components/')).forEach(folder => {
fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => { fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => {
if (/\.vue$/.test(file) || /\.js$/.test(file)) { if (/\.vue$/.test(file) || /\.js$/.test(file)) {
let filename = file.split('.vue')[0].toLowerCase(); let filename = file.split('.vue')[0].toLowerCase();
execSync( execSync(
`node ${vueCliServicePath} build src/components/${folder}/${file} --target lib --name ${filename} --dest components/${folder} --no-clean ` `node ${vueCliServicePath} build src/components/${folder}/${file} --target lib --name ${filename} --dest components/${folder} --no-clean `
) )
let shorthandContent =
`'use strict';\nmodule.exports = require('./components/${folder}/${filename}.common');
`;
fs.writeFileSync('./exports' + filename +'.js', shorthandContent, function (err) {
if (err) throw err;
console.log('Saved!');
});
} }
}); });
}); });

View File

@ -11,7 +11,7 @@ import Chart from './components/chart/Chart';
import Checkbox from './components/checkbox/Checkbox'; import Checkbox from './components/checkbox/Checkbox';
import Chips from './components/chips/Chips'; import Chips from './components/chips/Chips';
import DataView from './components/dataview/DataView'; import DataView from './components/dataview/DataView';
import DataViewLayoutOptions from './components/dataview/DataViewLayoutOptions'; import DataViewLayoutOptions from './components/dataviewlayoutoptions/DataViewLayoutOptions';
import Dialog from './components/dialog/Dialog'; import Dialog from './components/dialog/Dialog';
import Dropdown from './components/dropdown/Dropdown'; import Dropdown from './components/dropdown/Dropdown';
import Editor from './components/editor/Editor'; import Editor from './components/editor/Editor';