hookehuyr

fix

1 /* jshint esversion: 6 */ 1 /* jshint esversion: 6 */
2 const vuxLoader = require('vux-loader'); 2 const vuxLoader = require('vux-loader');
3 const webpack = require('webpack'); 3 const webpack = require('webpack');
4 -const merge = require('webpack-merge'); 4 +// const merge = require('webpack-merge');
5 5
6 module.exports = { 6 module.exports = {
7 // 基本路径 7 // 基本路径
...@@ -48,35 +48,21 @@ module.exports = { ...@@ -48,35 +48,21 @@ module.exports = {
48 options: {}, 48 options: {},
49 plugins: ['vux-ui'] 49 plugins: ['vux-ui']
50 }); 50 });
51 - merge(config, { 51 + config.plugins.push(
52 - plugins: [ 52 + new webpack.ProvidePlugin({
53 - new webpack.ProvidePlugin({ 53 + $: 'jquery',
54 - $: 'jquery', 54 + jQuery: 'jquery',
55 - jQuery: 'jquery', 55 + '_': 'lodash',
56 - '_': 'lodash', 56 + 'axios': 'axios',
57 - 'axios': 'axios', 57 + 'moment': 'moment'
58 - 'moment': 'moment' 58 + })
59 - }) 59 + );
60 - ]
61 - });
62 if (process.env.NODE_ENV === 'production') { 60 if (process.env.NODE_ENV === 'production') {
63 // 为生产环境修改配置... 61 // 为生产环境修改配置...
64 } else { 62 } else {
65 // 为开发环境修改配置... 63 // 为开发环境修改配置...
66 - console.warn(merge);
67 } 64 }
68 }, 65 },
69 - // configureWebpack: {
70 - // plugins: [
71 - // new webpack.ProvidePlugin({
72 - // $: 'jquery',
73 - // jQuery: 'jquery',
74 - // '_': 'lodash',
75 - // 'axios': 'axios',
76 - // 'moment': 'moment'
77 - // })
78 - // ]
79 - // },
80 // 是一个函数,会接收一个基于 webpack-chain 的 ChainableConfig 实例。允许对内部的 webpack 配置进行更细粒度的修改。 66 // 是一个函数,会接收一个基于 webpack-chain 的 ChainableConfig 实例。允许对内部的 webpack 配置进行更细粒度的修改。
81 chainWebpack: () => {}, 67 chainWebpack: () => {},
82 // css相关配置 68 // css相关配置
......