[improvement] entry file ts (#2802)

This commit is contained in:
neverland
2019-02-20 11:37:02 +08:00
committed by GitHub
parent 5c7c14d8df
commit 0ddafc77d8
6 changed files with 22 additions and 8 deletions
+9 -2
View File
@@ -22,14 +22,21 @@ function buildVantEntry() {
const exportList = Components.map(name => `${uppercamelize(name)}`);
const intallList = exportList.filter(name => !~uninstallComponents.indexOf(uppercamelize(name)));
const content = `${tips}
import { VueConstructor } from 'vue/types';
${importList.join('\n')}
declare global {
interface Window {
Vue?: VueConstructor;
}
}
const version = '${version}';
const components = [
${intallList.join(',\n ')}
];
const install = Vue => {
const install = (Vue: VueConstructor) => {
components.forEach(Component => {
Vue.use(Component);
});
@@ -52,7 +59,7 @@ export default {
};
`;
fs.writeFileSync(path.join(__dirname, '../packages/index.js'), content);
fs.writeFileSync(path.join(__dirname, '../packages/index.ts'), content);
}
function buildDemoEntry() {
+1 -1
View File
@@ -2,7 +2,7 @@ const fs = require('fs');
const path = require('path');
const excludes = [
'index.js',
'index.ts',
'index.less',
'style',
'mixins',