Merge remote-tracking branch 'origin/release/4.0' into feature/new-category
# Conflicts: # src/components/resources/index.js
Showing
10 changed files
with
49 additions
and
66 deletions
.vscode/launch.json
0 → 100644
.vscode/settings.json
0 → 100644
@@ -2,19 +2,18 @@ const webpack = require('webpack'); | @@ -2,19 +2,18 @@ const webpack = require('webpack'); | ||
2 | const path = require('path'); | 2 | const path = require('path'); |
3 | const merge = require('webpack-merge'); | 3 | const merge = require('webpack-merge'); |
4 | const VueSSRClientPlugin = require('vue-server-renderer/client-plugin'); | 4 | const VueSSRClientPlugin = require('vue-server-renderer/client-plugin'); |
5 | -const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); | ||
6 | const pkg = require('../package.json'); | 5 | const pkg = require('../package.json'); |
7 | -const shelljs = require('shelljs'); | 6 | +// const shelljs = require('shelljs'); |
8 | 7 | ||
9 | let baseConfig = require('./webpack.base.conf'); | 8 | let baseConfig = require('./webpack.base.conf'); |
10 | const postcssConfig = require('./postcss.config.js'); | 9 | const postcssConfig = require('./postcss.config.js'); |
11 | 10 | ||
12 | const isProd = process.env.NODE_ENV === 'production'; | 11 | const isProd = process.env.NODE_ENV === 'production'; |
13 | 12 | ||
14 | -if (process.env.NODE_ENV === 'production') { | ||
15 | - shelljs.exec(`cp -R ${path.join(__dirname, '../public/font/')} ${path.join(__dirname, '../src/statics/font/')}`, {async: true}); | ||
16 | - shelljs.exec(`cp -R ${path.join(__dirname, '../public/img/')} ${path.join(__dirname, '../src/statics/img/')}`, {async: true}); | ||
17 | -} | 13 | +// if (process.env.NODE_ENV === 'production') { |
14 | +// shelljs.exec(`cp -R ${path.join(__dirname, '../public/font/')} ${path.join(__dirname, '../src/statics/font/')}`, {async: true}); | ||
15 | +// shelljs.exec(`cp -R ${path.join(__dirname, '../public/img/')} ${path.join(__dirname, '../src/statics/img/')}`, {async: true}); | ||
16 | +// } | ||
18 | 17 | ||
19 | const webpackConfig = merge(baseConfig, { | 18 | const webpackConfig = merge(baseConfig, { |
20 | entry: { | 19 | entry: { |
@@ -66,11 +65,22 @@ const webpackConfig = merge(baseConfig, { | @@ -66,11 +65,22 @@ const webpackConfig = merge(baseConfig, { | ||
66 | }); | 65 | }); |
67 | 66 | ||
68 | if (process.env.NODE_ENV === 'production') { | 67 | if (process.env.NODE_ENV === 'production') { |
69 | - webpackConfig.plugins.push(new UglifyJSPlugin({ | 68 | + webpackConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({ |
70 | parallel: true, | 69 | parallel: true, |
71 | - sourceMap: true | 70 | + sourceMap: true, |
71 | + uglifyOptions: { | ||
72 | + compress: { | ||
73 | + warnings: false | ||
74 | + }, | ||
75 | + comments: false | ||
76 | + } | ||
72 | })); | 77 | })); |
73 | webpackConfig.output.publicPath = '//cdn.yoho.cn/yohoblk-wap/bundle/'; | 78 | webpackConfig.output.publicPath = '//cdn.yoho.cn/yohoblk-wap/bundle/'; |
74 | 79 | ||
75 | } | 80 | } |
81 | + | ||
82 | +let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | ||
83 | + | ||
84 | +webpackConfig.plugins.push(new BundleAnalyzerPlugin()); | ||
85 | + | ||
76 | module.exports = webpackConfig; | 86 | module.exports = webpackConfig; |
@@ -129,7 +129,7 @@ | @@ -129,7 +129,7 @@ | ||
129 | "vue-touch": "2.0.0-beta.3", | 129 | "vue-touch": "2.0.0-beta.3", |
130 | "vuex": "^3.0.1", | 130 | "vuex": "^3.0.1", |
131 | "webpack": "3.3", | 131 | "webpack": "3.3", |
132 | - "webpack-bundle-analyzer": "^2.9.0", | 132 | + "webpack-bundle-analyzer": "^2.9.1", |
133 | "webpack-dashboard": "^0.1.8", | 133 | "webpack-dashboard": "^0.1.8", |
134 | "webpack-dev-middleware": "^1.12.0", | 134 | "webpack-dev-middleware": "^1.12.0", |
135 | "webpack-dev-server": "^2.6.1", | 135 | "webpack-dev-server": "^2.6.1", |
@@ -4,7 +4,6 @@ import ResourceTwoImage from './resource-two-image'; | @@ -4,7 +4,6 @@ import ResourceTwoImage from './resource-two-image'; | ||
4 | import ResourceFocusImage from './resource-focus-image'; | 4 | import ResourceFocusImage from './resource-focus-image'; |
5 | import ResourceSingleImage from './resource-single-image'; | 5 | import ResourceSingleImage from './resource-single-image'; |
6 | import ResourceProductList from './resource-product-list'; | 6 | import ResourceProductList from './resource-product-list'; |
7 | -import ResourceShopFloor from './resource-shop-floor'; | ||
8 | import ResourceBlkNewProductList from './resource-new-product-list'; | 7 | import ResourceBlkNewProductList from './resource-new-product-list'; |
9 | 8 | ||
10 | export { | 9 | export { |
@@ -13,7 +12,7 @@ export { | @@ -13,7 +12,7 @@ export { | ||
13 | ResourceTwoImage, | 12 | ResourceTwoImage, |
14 | ResourceSingleImage, | 13 | ResourceSingleImage, |
15 | ResourceProductList, | 14 | ResourceProductList, |
16 | - ResourceShopFloor, | 15 | + ResourceFocusImage, |
17 | ResourceFocusImage, | 16 | ResourceFocusImage, |
18 | ResourceBlkNewProductList | 17 | ResourceBlkNewProductList |
19 | }; | 18 | }; |
1 | -<template> | ||
2 | - <resource> | ||
3 | - <!-- <resource-single-image></resource-single-image> | ||
4 | - <resource-product-list></resource-product-list> --> | ||
5 | - </resource> | ||
6 | -</template> | ||
7 | - | ||
8 | -<script> | ||
9 | -import Resource from './resource'; | ||
10 | -import ResourceSingleImage from './resource-single-image'; | ||
11 | -import ResourcePoductList from './resource-product-list'; | ||
12 | - | ||
13 | -export default { | ||
14 | - name: 'ResourceShopFloor', | ||
15 | - props: { | ||
16 | - value: Object | ||
17 | - }, | ||
18 | - components: {Resource, ResourceSingleImage, ResourcePoductList} | ||
19 | -}; | ||
20 | -</script> | ||
21 | - | ||
22 | -<style lang="scss"> | ||
23 | -.resource-products { | ||
24 | - width: 100%; | ||
25 | - overflow-x: scroll; | ||
26 | - -webkit-overflow-scrolling: touch; | ||
27 | - white-space: nowrap; | ||
28 | - | ||
29 | - li.product-item { | ||
30 | - display: inline-block; | ||
31 | - padding-right: 20px; | ||
32 | - text-align: center; | ||
33 | - line-height: 40px; | ||
34 | - | ||
35 | - img { | ||
36 | - width: 188px; | ||
37 | - height: 250px; | ||
38 | - } | ||
39 | - } | ||
40 | -} | ||
41 | -</style> |
@@ -12,9 +12,9 @@ export default context => { | @@ -12,9 +12,9 @@ export default context => { | ||
12 | 12 | ||
13 | const route = router.resolve(url).route; | 13 | const route = router.resolve(url).route; |
14 | 14 | ||
15 | - if (url !== route.fullPath && url !== route.redirectedFrom) { | ||
16 | - return reject({url: route.fullPath}); | ||
17 | - } | 15 | + // if (url !== route.fullPath) { |
16 | + // return reject({code: 500, message: 'url not matched', url: route.fullPath}); | ||
17 | + // } | ||
18 | store.commit(SET_ENV, context.env); | 18 | store.commit(SET_ENV, context.env); |
19 | router.push(url); | 19 | router.push(url); |
20 | router.onReady(() => { | 20 | router.onReady(() => { |
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | <div class="resources"> | 18 | <div class="resources"> |
19 | <component | 19 | <component |
20 | :is="component.template_name" | 20 | :is="component.template_name" |
21 | - v-for="(component, index) in channel.home.filter(c => ['twoPicture', 'newSingleImage', 'shopFloor', 'BlkNewProductFloorResource'].some(k => k === c.template_name) )" | 21 | + v-for="(component, index) in channel.home.filter(c => ['twoPicture', 'newSingleImage', 'BlkNewProductFloorResource'].some(k => k === c.template_name) )" |
22 | :value="component.data" | 22 | :value="component.data" |
23 | :key="index"></component> | 23 | :key="index"></component> |
24 | </div> | 24 | </div> |
@@ -31,12 +31,9 @@ | @@ -31,12 +31,9 @@ | ||
31 | import { | 31 | import { |
32 | FETCH_HOME_REQUEST | 32 | FETCH_HOME_REQUEST |
33 | } from 'store/channel/types'; | 33 | } from 'store/channel/types'; |
34 | -import { | ||
35 | - ResourceTwoImage, | ||
36 | - ResourceSingleImage, | ||
37 | - ResourceShopFloor, | ||
38 | - ResourceProductList | ||
39 | -} from 'components/resources'; | 34 | +import ResourceTwoImage from 'components/resources/resource-two-image'; |
35 | +import ResourceSingleImage from 'components/resources/resource-single-image'; | ||
36 | +import ResourceProductList from 'components/resources/resource-product-list'; | ||
40 | import {SearchSlider} from 'components/search'; | 37 | import {SearchSlider} from 'components/search'; |
41 | import {mapState} from 'vuex'; | 38 | import {mapState} from 'vuex'; |
42 | import {HomeSlider} from './components'; | 39 | import {HomeSlider} from './components'; |
@@ -70,7 +67,6 @@ export default { | @@ -70,7 +67,6 @@ export default { | ||
70 | components: { | 67 | components: { |
71 | twoPicture: ResourceTwoImage, | 68 | twoPicture: ResourceTwoImage, |
72 | newSingleImage: ResourceSingleImage, | 69 | newSingleImage: ResourceSingleImage, |
73 | - shopFloor: ResourceShopFloor, | ||
74 | BlkNewProductFloorResource: ResourceProductList, | 70 | BlkNewProductFloorResource: ResourceProductList, |
75 | SearchSlider, | 71 | SearchSlider, |
76 | HomeSlider | 72 | HomeSlider |
@@ -9217,7 +9217,7 @@ wbuf@^1.1.0, wbuf@^1.7.2: | @@ -9217,7 +9217,7 @@ wbuf@^1.1.0, wbuf@^1.7.2: | ||
9217 | dependencies: | 9217 | dependencies: |
9218 | minimalistic-assert "^1.0.0" | 9218 | minimalistic-assert "^1.0.0" |
9219 | 9219 | ||
9220 | -webpack-bundle-analyzer@^2.9.0: | 9220 | +webpack-bundle-analyzer@^2.9.1: |
9221 | version "2.9.1" | 9221 | version "2.9.1" |
9222 | resolved "http://npm.yoho.cn/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.9.1.tgz#c2c8e03e8e5768ed288b39ae9e27a8b8d7b9d476" | 9222 | resolved "http://npm.yoho.cn/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.9.1.tgz#c2c8e03e8e5768ed288b39ae9e27a8b8d7b9d476" |
9223 | dependencies: | 9223 | dependencies: |
-
Please register or login to post a comment