Authored by 陈峰

mini

{
"presets": ["es2015","stage-0"],
"presets": ["es2015", "stage-0"],
"plugins": [
"transform-runtime",
"syntax-dynamic-import"
... ...
This diff could not be displayed because it is too large.
... ... @@ -8,7 +8,7 @@
],
"main": "build/sdk.js",
"scripts": {
"build": "webpack --mode development --config ./webpack.config.babel.js ",
"build": "webpack --mode production --config ./webpack.config.js ",
"lint-js": "lint-js"
},
"config": {
... ... @@ -32,27 +32,28 @@
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
"babel-plugin-import": "^1.7.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"clean-webpack-plugin": "^0.1.19",
"compression-webpack-plugin": "^1.1.11",
"copy-webpack-plugin": "^4.5.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"uglifyjs-webpack-plugin": "^2.0.1",
"file-loader": "^1.1.11",
"url-loader": "^1.0.1",
"webpack": "^4.17.2",
"webpack-cli": "^2.0.14",
"weixin-js-sdk": "^1.3.3",
"fetch-jsonp": "^1.1.3",
"eslint": "^3.19.0",
"eslint-config-yoho": "^1.0.1",
"eslint-loader": "^1.7.1",
"eslint-plugin-html": "^2.0.3",
"promise-polyfill": "^8.1.0"
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"fetch-jsonp": "^1.1.3",
"file-loader": "^1.1.11",
"promise-polyfill": "^8.1.0",
"uglifyjs-webpack-plugin": "^2.0.1",
"url-loader": "^1.0.1",
"webpack": "^4.17.2",
"webpack-bundle-analyzer": "^3.0.3",
"webpack-cli": "^3.1.2",
"weixin-js-sdk": "^1.3.3"
},
"dependencies": {},
"directories": {
... ...
import wx from 'weixin-js-sdk';
import {linkToMiniApp, invokeMethod, createLinkButton} from "../utils/common";
export default class {
... ...
import wx from 'weixin-js-sdk';
import {createLinkButton} from "../utils/common";
import base from './base';
... ...
//初始化config信息
import httpServer from '../utils/jsonp';
import wx from "weixin-js-sdk";
const _weChatInterface = '//action.yoho.cn/api/share/getSignPackage';//签名等相关配置,yoho公众号
export default class {
... ...
import wx from "weixin-js-sdk";
const invokeMethod = (obj) => {
if (window.yohoInterface) {
window.yohoInterface.triggerEvent(obj.success || function () {
... ...
import webpack,{DefinePlugin} from 'webpack';
import path from 'path';
import CleanWebpackPlugin from 'clean-webpack-plugin';
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const uglify = require('uglifyjs-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
let pathsToClean = [
'build'
... ... @@ -13,6 +13,7 @@ let cleanOptions = {
};
module.exports = {
//项目入口js文件
mode: 'production',
entry: ['./src/index.js'],
//项目输出目录
output: {
... ... @@ -25,7 +26,8 @@ module.exports = {
//插件
plugins: [
new CleanWebpackPlugin(pathsToClean, cleanOptions),//清除历史版本
new uglify({test: /\.js($|\?)/i,parallel: false})
// new BundleAnalyzerPlugin()
// new uglify({test: /\.js($|\?)/i,parallel: false})
],
//加载器
module: {
... ... @@ -41,7 +43,7 @@ module.exports = {
}
]
},
devtool: "inline-source-map",
// devtool: "inline-source-map",
//模块路径
resolve:{
alias: {
... ...
This diff could not be displayed because it is too large.