vuejs-templates / webpack

A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught SyntaxError: Use of const in strict mode.

tkggusraqk opened this issue · comments

vue-cli3 构建的项目,调试正常,build之后android()手机无法打开 ,错误信息:
Uncaught SyntaxError: Use of const in strict mode. at /js/chunk-vendors.b186bd1a.js:1,
发现里面有const,let这些.
package.json配置
`
{
"name": "wx-friend",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"jQuery": "^1.7.4",
"jsdom": "^13.0.0",
"location": "0.0.1",
"navigator": "^1.0.1",
"vue": "^2.5.17",
"vue-lazyload": "^1.2.6",
"vue-router": "^3.0.1",
"xmlhttprequest": "^1.8.0"
},
"devDependencies": {
"@babel/core": "^7.1.2",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@vue/cli-plugin-babel": "^3.0.5",
"@vue/cli-service": "^3.0.5",
"babel-loader": "^8.0.4",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"vue-template-compiler": "^2.5.17"
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}

babel 配置:
module.exports = {
presets: [
'@vue/app',
["@babel/preset-env", {
"useBuiltIns": "entry",
"modules": false
}]
],
"plugins": [
[

  "@babel/plugin-transform-runtime", {

    "corejs": false,

    "helpers": false,

    "regenerator": false,

    "useESModules": false

  }

]

],

"comments": false
}
`