From 4d974ce6192a15eb6e4f1370cdcd76f1843fed72 Mon Sep 17 00:00:00 2001 From: cookfront Date: Fri, 31 Mar 2017 20:12:45 +0800 Subject: [PATCH] popup docs --- build/bin/build-entry.js | 3 +- build/genExamples.js | 3 +- build/webpack.config.js | 30 ++++----- docs/components/mobile-popup.vue | 2 +- docs/examples-dist/popup.vue | 102 ++++++++++++++++--------------- docs/examples-docs/popup.md | 9 ++- package.json | 1 + 7 files changed, 81 insertions(+), 69 deletions(-) diff --git a/build/bin/build-entry.js b/build/bin/build-entry.js index 3343ac7a6..b58e200be 100644 --- a/build/bin/build-entry.js +++ b/build/bin/build-entry.js @@ -3,6 +3,7 @@ var fs = require('fs'); var render = require('json-templater/string'); var uppercamelcase = require('uppercamelcase'); var path = require('path'); +var chalk = require('chalk'); var OUTPUT_PATH = path.join(__dirname, '../../src/index.js'); var IMPORT_TEMPLATE = 'import {{name}} from \'../packages/{{package}}/index.js\';'; @@ -70,5 +71,5 @@ var template = render(MAIN_TEMPLATE, { }); fs.writeFileSync(OUTPUT_PATH, template); -console.log('[build entry] DONE:', OUTPUT_PATH); +console.log(chalk.green('[build entry] DONE:' + OUTPUT_PATH)); diff --git a/build/genExamples.js b/build/genExamples.js index 156effb99..129dc1e0e 100644 --- a/build/genExamples.js +++ b/build/genExamples.js @@ -3,6 +3,7 @@ var markdownItContainer = require('markdown-it-container'); var fs = require('fs'); var path = require('path'); var cheerio = require('cheerio'); +var chalk = require('chalk'); var striptags = require('./strip-tags'); var navs = require('../docs/nav.config.json'); navs = navs['zh-CN']; @@ -106,5 +107,5 @@ for (var i = 0; i < components.length; i++) { }); } -console.log('generate examples success!'); +console.log(chalk.green('generate examples success!')); diff --git a/build/webpack.config.js b/build/webpack.config.js index f67f32fef..d10a4eada 100644 --- a/build/webpack.config.js +++ b/build/webpack.config.js @@ -48,7 +48,7 @@ module.exports = { path.join(__dirname, '../node_modules'), 'node_modules' ], - extensions: ['.js', '.vue', '.pcss'], + extensions: ['.js', '.vue', '.css'], alias: { 'vue$': 'vue/dist/vue.runtime.common.js', 'zanui': path.join(__dirname, '..'), @@ -97,20 +97,7 @@ module.exports = { }, devtool: 'source-map', plugins: [ - StyleExtractPlugin, new ProgressBarPlugin(), - new HtmlWebpackPlugin({ - chunks: ['vendor', 'zan-docs'], - template: 'docs/index.tpl', - filename: 'index.html', - inject: true - }), - new HtmlWebpackPlugin({ - chunks: ['vendor', 'zan-examples'], - template: 'docs/index.tpl', - filename: 'examples.html', - inject: true - }), new webpack.LoaderOptionsPlugin({ minimize: true, options: { @@ -160,7 +147,20 @@ module.exports = { } } } - }) + }), + new HtmlWebpackPlugin({ + chunks: ['vendor', 'zan-docs'], + template: 'docs/index.tpl', + filename: 'index.html', + inject: true + }), + new HtmlWebpackPlugin({ + chunks: ['vendor', 'zan-examples'], + template: 'docs/index.tpl', + filename: 'examples.html', + inject: true + }), + StyleExtractPlugin ] }; diff --git a/docs/components/mobile-popup.vue b/docs/components/mobile-popup.vue index 160872d5b..b767556f5 100644 --- a/docs/components/mobile-popup.vue +++ b/docs/components/mobile-popup.vue @@ -1,5 +1,5 @@