[improvement] entry file ts (#2802)
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -2,7 +2,7 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const excludes = [
|
||||
'index.js',
|
||||
'index.ts',
|
||||
'index.less',
|
||||
'style',
|
||||
'mixins',
|
||||
|
||||
Reference in New Issue
Block a user