diff --git a/README.md b/README.md index 84a0b9f70..902ff7fc2 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,13 @@ npm run dev ``` 浏览器访问[http://localhost:8080](http://localhost:8080)就可以看到所有组件的示例了。 + +## 四、手机预览 + +可以手机扫码以下二维码访问手机端demo: + +![zanui_vue_mobile_qrcode](https://img.yzcdn.cn/v2/image/youzanyun/zanui/pc/zanui_vue_mobile_preview_03.png) -## 四、开源协议 +## 五、开源协议 本项目基于 [MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) 协议,请自由地享受和参与开源。 diff --git a/build/webpack.config.js b/build/webpack.config.dev.js similarity index 71% rename from build/webpack.config.js rename to build/webpack.config.dev.js index 837954b40..a078e7e5e 100644 --- a/build/webpack.config.js +++ b/build/webpack.config.dev.js @@ -5,10 +5,8 @@ var striptags = require('./strip-tags'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var getPoastcssPlugin = require('./utils/postcss_pipe'); var ProgressBarPlugin = require('progress-bar-webpack-plugin'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); -var FaviconsWebpackPlugin = require('favicons-webpack-plugin'); var StyleExtractPlugin; if (process.env.NODE_ENV === 'production') { @@ -172,66 +170,3 @@ module.exports = { StyleExtractPlugin ] }; - -if (process.env.NODE_ENV === 'production') { - delete module.exports.devtool; - module.exports.output = { - path: path.join(__dirname, '../docs/dist'), - publicPath: '/zanui/vue', - filename: '[name].[hash:8].js' - }; - module.exports.plugins = module.exports.plugins.concat([ - new webpack.DefinePlugin({ - 'process.env': { - NODE_ENV: JSON.stringify(process.env.NODE_ENV) - } - }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false, - drop_console: true - }, - output: { - comments: false - }, - sourceMap: false - }), - new webpack.optimize.CommonsChunkPlugin({ - name: 'vendor', - minChunks: Infinity - }), - new FaviconsWebpackPlugin({ - // Your source logo - logo: path.join(__dirname, '../docs/assets/ZanUIlogo256x256.png'), - // The prefix for all image files (might be a folder or a name) - prefix: 'favico-[hash]-', - // Emit all stats of the generated icons - // emitStats: false, - // The name of the json containing all favicon information - // statsFilename: 'iconstats-[hash].json', - // Generate a cache file with control hashes and - // don't rebuild the favicons until those hashes change - persistentCache: false, - // Inject the html into the html-webpack-plugin - inject: true, - // favicon background color (see https://github.com/haydenbleasel/favicons#usage) - background: '#fff', - // favicon app title (see https://github.com/haydenbleasel/favicons#usage) - title: 'Vant', - - // which icons should be generated (see https://github.com/haydenbleasel/favicons#usage) - icons: { - android: true, - appleIcon: true, - appleStartup: true, - coast: false, - favicons: true, - firefox: true, - opengraph: false, - twitter: false, - yandex: false, - windows: false - } - }) - ]); -} diff --git a/build/webpack.config.prod.js b/build/webpack.config.prod.js new file mode 100644 index 000000000..f7a46de6a --- /dev/null +++ b/build/webpack.config.prod.js @@ -0,0 +1,34 @@ +var webpack = require('webpack'); +var merge = require('webpack-merge'); +var path = require('path'); +var devConfig = require('./webpack.config.dev.js'); + +module.exports = merge(devConfig, { + output: { + path: path.join(__dirname, '../docs/dist'), + publicPath: '/zanui/vue', + filename: '[name].[hash:8].js' + }, + devtool: false, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify(process.env.NODE_ENV) + } + }), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false, + drop_console: true + }, + output: { + comments: false + }, + sourceMap: false + }), + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks: Infinity + }) + ] +}); diff --git a/docs/assets/ZanUIlogo256x256.png b/docs/assets/ZanUIlogo256x256.png deleted file mode 100644 index 0b32f4338..000000000 Binary files a/docs/assets/ZanUIlogo256x256.png and /dev/null differ diff --git a/docs/assets/docs.css b/docs/assets/docs.css index 9c18a759c..883417310 100644 --- a/docs/assets/docs.css +++ b/docs/assets/docs.css @@ -67,7 +67,7 @@ code.hljs { } .main-content { - margin: 110px 20px 40px; + margin: 130px 20px 40px; padding-top: 20px; } diff --git a/docs/assets/zanui.ico b/docs/assets/zanui.ico new file mode 100644 index 000000000..e53ed3d16 Binary files /dev/null and b/docs/assets/zanui.ico differ diff --git a/docs/src/components/page-footer.vue b/docs/src/components/page-footer.vue index 7a79ba67e..d840c518b 100644 --- a/docs/src/components/page-footer.vue +++ b/docs/src/components/page-footer.vue @@ -5,7 +5,7 @@ 有赞官网