Commit 4d291e8e authored by jsz315's avatar jsz315

h5

parent d3e7af8b
...@@ -110,6 +110,8 @@ exports.computeEntry = function(entry) { ...@@ -110,6 +110,8 @@ exports.computeEntry = function(entry) {
result[pathBuild + name] = [entryJsPath]; result[pathBuild + name] = [entryJsPath];
} }
// result["vendor"] = ['vue', 'vue-router', 'axios'];
console.log(result);
return result; return result;
}; };
......
...@@ -8,7 +8,7 @@ const merge = require("webpack-merge"); ...@@ -8,7 +8,7 @@ const merge = require("webpack-merge");
const webpack = require("webpack"); const webpack = require("webpack");
const path = require("path"); const path = require("path");
const FriendlyErrorsPlugin = require("friendly-errors-webpack-plugin"); const FriendlyErrorsPlugin = require("friendly-errors-webpack-plugin");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const baseWebpackConfig = require("./webpack.base.conf"); const baseWebpackConfig = require("./webpack.base.conf");
const utils = require("./utils"); const utils = require("./utils");
const config = require("../config"); const config = require("../config");
...@@ -41,7 +41,38 @@ const devWebpackConfig = merge(baseWebpackConfig, { ...@@ -41,7 +41,38 @@ const devWebpackConfig = merge(baseWebpackConfig, {
}) })
}, },
devtool: config.build.devtool, devtool: config.build.devtool,
optimization: {
// minimize: false,
minimizer: [
new UglifyJsPlugin({
uglifyOptions: config.build.uglifyConfig
})
],
// 分割代码块
splitChunks: {
chunks: 'async',
minSize: 30000,
minChunks: 1,
maxAsyncRequests: 5,
maxInitialRequests: 3,
name: true,
cacheGroups: {
// common: {
// name: "common",
// chunks: "all",
// // minSize: 1,
// priority: 0
// },
// vendor: {
// name: "vendor",
// test: /[\\/]node_modules[\\/]/,
// chunks: "all",
// priority: 10
// }
}
}
// runtimeChunk: true
},
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
HTTP: http.dev.HTTP, HTTP: http.dev.HTTP,
...@@ -58,7 +89,7 @@ const devWebpackConfig = merge(baseWebpackConfig, { ...@@ -58,7 +89,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
// should the console be cleared between each compilation? // should the console be cleared between each compilation?
// default is true // default is true
clearConsole: true clearConsole: true
}) }),
// new webpack.ProvidePlugin({ // new webpack.ProvidePlugin({
// _: "underscore" // _: "underscore"
// }) // })
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @author : Dec-F * @author : Dec-F
* @Date : 2018-08-17 14:16:56 * @Date : 2018-08-17 14:16:56
* @Last Modified by: 江思志 * @Last Modified by: 江思志
* @Last Modified time: 2019-03-13 10:49:01 * @Last Modified time: 2019-03-19 17:03:01
*/ */
import Vue from 'vue'; import Vue from 'vue';
......
...@@ -201,17 +201,24 @@ export default { ...@@ -201,17 +201,24 @@ export default {
}); });
} }
}, },
goActivitySetting(item) { async goActivitySetting(item) {
let id = item.id; let obj = JSON.parse(item.text);
let obj = JSON.parse(item.text); let params = {
contentId: item.id
};
let res = await get(API.getScId, params);
if (res.success) {
let id = res.data;
let url = formatUrl('/pages/activity/link/main', { let url = formatUrl('/pages/activity/link/main', {
scid: id, scid: id,
img: obj.previewImageUrl, img: obj.previewImageUrl,
url: obj.activity_url url: obj.activity_url
}); });
wx.miniProgram.navigateTo({ wx.miniProgram.navigateTo({
url: url url: url
}); });
}
}, },
goArticlList() { goArticlList() {
let url = '/pages/content/articleList/main'; let url = '/pages/content/articleList/main';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment