From be012e97a2ca21d68b32bea55025067ee3222b65 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Sat, 25 May 2019 19:03:57 +0300 Subject: [PATCH] DataView import refactor --- build-lib.js | 10 ++++++++++ .../DataViewLayoutOptions.vue | 0 src/main.js | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) rename src/components/{dataview => dataviewlayoutoptions}/DataViewLayoutOptions.vue (100%) diff --git a/build-lib.js b/build-lib.js index 254690122..cfe05468b 100644 --- a/build-lib.js +++ b/build-lib.js @@ -7,9 +7,19 @@ fs.readdirSync(path.resolve(__dirname, './src/components/')).forEach(folder => { fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => { if (/\.vue$/.test(file) || /\.js$/.test(file)) { let filename = file.split('.vue')[0].toLowerCase(); + execSync( `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!'); + }); } }); }); \ No newline at end of file diff --git a/src/components/dataview/DataViewLayoutOptions.vue b/src/components/dataviewlayoutoptions/DataViewLayoutOptions.vue similarity index 100% rename from src/components/dataview/DataViewLayoutOptions.vue rename to src/components/dataviewlayoutoptions/DataViewLayoutOptions.vue diff --git a/src/main.js b/src/main.js index 95af6ada8..22fd89e84 100644 --- a/src/main.js +++ b/src/main.js @@ -11,7 +11,7 @@ import Chart from './components/chart/Chart'; import Checkbox from './components/checkbox/Checkbox'; import Chips from './components/chips/Chips'; 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 Dropdown from './components/dropdown/Dropdown'; import Editor from './components/editor/Editor';