mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 03:11:15 +00:00
chore: move deps to cli
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
const uppercamelize = require('uppercamelcase');
|
||||
const Components = require('./get-components')();
|
||||
const packageJson = require('../package.json');
|
||||
|
||||
const camelizeRE = /-(\w)/g;
|
||||
const pascalizeRE = /(\w)(\w*)/g;
|
||||
|
||||
function camelize(str) {
|
||||
return str.replace(camelizeRE, (_, c) => c.toUpperCase());
|
||||
}
|
||||
|
||||
function pascalize(str) {
|
||||
return camelize(str).replace(
|
||||
pascalizeRE,
|
||||
(_, c1, c2) => c1.toUpperCase() + c2
|
||||
);
|
||||
}
|
||||
|
||||
const version = process.env.VERSION || packageJson.version;
|
||||
const tips = '// This file is auto generated by build/build-entry.js';
|
||||
|
||||
@@ -14,9 +27,9 @@ function buildEntry() {
|
||||
'Waterfall'
|
||||
];
|
||||
|
||||
const importList = Components.map(name => `import ${uppercamelize(name)} from './${name}';`);
|
||||
const exportList = Components.map(name => `${uppercamelize(name)}`);
|
||||
const installList = exportList.filter(name => !~uninstallComponents.indexOf(uppercamelize(name)));
|
||||
const importList = Components.map(name => `import ${pascalize(name)} from './${name}';`);
|
||||
const exportList = Components.map(name => `${pascalize(name)}`);
|
||||
const installList = exportList.filter(name => !~uninstallComponents.indexOf(pascalize(name)));
|
||||
const content = `${tips}
|
||||
import { VueConstructor } from 'vue/types';
|
||||
${importList.join('\n')}
|
||||
|
Reference in New Issue
Block a user