new webpack.ProvidePlugin vue模块化的全局引用
目前在vue-cli2运用 webpack.base.conf.js new webpack.ProvidePlugin({ jQuery: 'jquery', $: 'jquery', Gdata: ['@/api/index.js', 'default'], RequestApi: resolve('/static/config/index.js') }) static/config/index.js const peconfig = 'devCompXs'; switch (peconfig) { case 'devPloce': var DUTY_URL_INTERNET = '//10.95.1.210:10021'; var WEBSOCKET_INTERNET = 'ws://10.95.1.210:10021/commonwebsocket/channels/test'; var MAPCONTROL_SOCKET_INTERNET = 'ws://10.95.1.210:10021/websocket/mapControl/127.0.0.1'; //这条目前没有业务用注释着 var VIDEO_SOCKET_INTERNET = 'ws://10.95.1.210:10021/websocket/vidoControl/127.0.0.1'; var