1.项目在IE中无法运行,报错
2.错误代码
3.我已经下载并引入相关将es6变为es5以及babel.lrc文件
{
"name": "litadmin",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "jerry9022@qq.com",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.16.1",
"axios-mock-adapter": "^1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.2",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2015-loose": "^8.0.0",
"bootstrap": "^3.3.7",
"echarts": "^3.5.3",
"element-ui": "^1.2.8",
"es3ify-loader": "^0.2.0",
"gridly": "^1.4.10",
"gridstack": "^0.3.0",
"highcharts": "^5.0.12",
"jquery": "^3.2.1",
"jquery-ui": "^1.12.1",
"jquery-ui-bundle": "^1.12.1",
"jquery.gridly": "^1.2.9",
"jqueryui": "^1.11.1",
"knockout": "^3.4.2",
"lodash": "^4.17.4",
"mockjs": "^1.0.1-beta3",
"socketcluster": "^6.0.1",
"socketcluster-client": "^5.5.2",
"vue": "^2.2.2",
"vue-highcharts": "0.0.10",
"vue-router": "^2.2.0",
"vuex": "^2.3.1"
},
"devDependencies": {
"autoprefixer": "^6.7.2",
"babel-core": "^6.22.1",
"babel-loader": "^6.2.10",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.2.1",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^1.1.3",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.26.4",
"element-ui": "^1.2.7",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.1",
"extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.10.0",
"friendly-errors-webpack-plugin": "^1.1.3",
"function-bind": "^1.1.0",
"html-webpack-plugin": "^2.29.0",
"http-proxy-middleware": "^0.17.3",
"node-sass": "^4.5.2",
"opn": "^4.0.2",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"ora": "^1.1.0",
"rimraf": "^2.6.0",
"sass-loader": "^6.0.3",
"script-loader": "^0.7.0",
"semver": "^5.3.0",
"style-loader": "^0.16.1",
"url-loader": "^0.5.7",
"vue-loader": "^11.1.4",
"vue-style-loader": "^2.0.0",
"vue-template-compiler": "^2.2.4",
"webpack": "^2.2.1",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.16.1",
"webpack-merge": "^2.6.1"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
4.求大神解决下
并不是webpack配置问题。也不是babel没编译。
这个锅其实是 webpack-dev-server的问题。它里面通过socket给浏览器的代码有 部分 es6的代码 如 const 这些。然后这种东西ie11以下并不认识
翻了webpack-dev-server的源码
https://github.com/webpack/we...
解决办法降低webpack-dev-server的版本。具体到多少。。懒得翻了。。