fix: delete unused doc css

This commit is contained in:
陈嘉涵
2017-08-15 13:24:19 +08:00
parent 4555d82c8e
commit 31d1ae392b
17 changed files with 75 additions and 723 deletions

View File

@@ -4,7 +4,7 @@ var render = require('json-templater/string');
var uppercamelcase = require('uppercamelcase');
var path = require('path');
var OUTPUT_PATH = path.join(__dirname, '../../src/index.js');
var OUTPUT_PATH = path.join(__dirname, '../../packages/index.js');
var IMPORT_TEMPLATE = 'import {{name}} from \'../packages/{{package}}/index.js\';';
var ISNTALL_COMPONENT_TEMPLATE = ' {{name}}';
var MAIN_TEMPLATE = `{{include}}

View File

@@ -1,3 +1,4 @@
import fs from 'fs';
import path from 'path';
import vue from 'rollup-plugin-vue';
import alias from 'zan-rollup-plugin-alias';
@@ -8,6 +9,17 @@ import componentsConfig from '../components.json';
const extensions = ['.js', '.vue'];
// 打包时排除 mixins、utils、其他组件
const utilsPath = path.resolve(__dirname, '../packages/common/utils/');
const mixinsPath = path.resolve(__dirname, '../packages/common/mixins/');
const external = [
...fs.readdirSync(utilsPath).map(item => path.resolve(utilsPath, item)),
...fs.readdirSync(mixinsPath).map(item => path.resolve(mixinsPath, item)),
...Object.keys(componentsConfig).map(component =>
path.resolve(__dirname, '../packages', component, 'index.js')
)
];
export default Object.keys(componentsConfig).map(component => {
return {
entry: componentsConfig[component],
@@ -17,7 +29,12 @@ export default Object.keys(componentsConfig).map(component => {
format: 'cjs'
}
],
external: ['vue', 'vue-lazyload'],
external: [
'vue',
'vue-lazyload',
path.resolve(__dirname, '../packages/common/mixins/popup/index.js'),
...external
],
plugins: [
vue(),
babel({
@@ -36,7 +53,7 @@ export default Object.keys(componentsConfig).map(component => {
'src/mixins': path.resolve(__dirname, '../packages/common/mixins'),
'src/utils': path.resolve(__dirname, '../packages/common/utils'),
packages: path.resolve(__dirname, '../packages')
}),
})
]
};
});

View File

@@ -3,7 +3,7 @@ const config = require('./webpack.config.dev.js');
const isMinify = process.argv.indexOf('-p') !== -1;
config.entry = {
'vant': './src/index.js'
'vant': './packages/index.js'
};
config.output = {

View File

@@ -1,31 +0,0 @@
const path = require('path');
const Components = require('../components.json');
const config = require('./webpack.build.js');
const webpack = require('webpack');
delete config.devtool;
const entry = {};
Object.keys(Components).forEach(key => {
entry[key + '/index'] = Components[key];
});
config.entry = entry;
config.externals = {
vue: {
root: 'Vue',
commonjs: 'vue',
commonjs2: 'vue',
amd: 'vue'
}
};
config.output = {
path: path.join(__dirname, '../lib'),
filename: '[name].js',
libraryExport: "default",
libraryTarget: 'umd'
};
module.exports = config;

View File

@@ -38,7 +38,8 @@ module.exports = {
extensions: ['.js', '.vue', '.css'],
alias: {
vue: 'vue/dist/vue.runtime.esm.js',
src: path.join(__dirname, '../src'),
'src/mixins': path.resolve(__dirname, '../packages/common/mixins'),
'src/utils': path.resolve(__dirname, '../packages/common/utils'),
packages: path.join(__dirname, '../packages'),
lib: path.join(__dirname, '../lib'),
components: path.join(__dirname, '../docs/src/components')