related files
babel.config.js
module.exports = {
presets: [
"@vue/app",
[
"env",
{
"modules": false,
"useBuiltIns": "entry"
}
],
"stage-0"
],
"plugins": [
["import", {
"libraryName": "iview",
"libraryDirectory": "src/components"
}],
["transform-runtime", {
"corejs": false,
"helpers": false,
"polyfill": false,
"regenerator": true,
"moduleName": "babel-runtime"
}]
],
"comments": false
}
package.json
{
"name": "housing_pc",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"vue": "^2.5.17",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.1.1",
"@vue/cli-service": "^3.1.4",
"axios": "^0.18.0",
"babel-plugin-import": "^1.11.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-0": "^6.24.1",
"babel-runtime": "^6.26.0",
"iview": "^3.1.5",
"node-sass": "^4.10.0",
"sass-loader": "^7.1.0",
"vue-template-compiler": "^2.5.17"
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
main.js
import "babel-polyfill"
import Vue from "vue"
import App from "./App.vue"
import router from "./router/router"
import store from "./vuex/store"
// import {
// Carousel,
// CarouselItem,
// Select,
// Option,
// Input
// } from "iview";
// import "iview/dist/styles/iview.css";
// Vue.component("Carousel", Carousel);
// Vue.component("CarouselItem", CarouselItem);
// Vue.component("Select", Select);
// Vue.component("Option", Option);
// Vue.component("Input", Input);
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount("-sharpapp")
vue-V
3.1.3
iview is used as the UI framework, but ie will report an error.
. / node_modules/iview/src/utils/assist.js
invalid SCRIPT1014: character
try to use babel, but
appearsModule build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Plugin/Preset files are not allowed to export objects, only functions. In D:\miniapp\housing_pc\node_modules\babel-preset-stage-0\lib\index.js
at createDescriptor (D:\miniapp\housing_pc\node_modules\@babel\core\lib\config\config-descriptors.js:178:11)
at items.map (D:\miniapp\housing_pc\node_modules\@babel\core\lib\config\config-descriptors.js:109:50)
at Array.map (<anonymous>)
at createDescriptors (D:\miniapp\housing_pc\node_modules\@babel\core\lib\config\config-descriptors.js:109:29)
at createPresetDescriptors (D:\miniapp\housing_pc\node_modules\@babel\core\lib\config\config-descriptors.js:101:10)
at presets (D:\miniapp\housing_pc\node_modules\@babel\core\lib\config\config-descriptors.js:47:19)
at mergeChainOpts (D:\miniapp\housing_pc\node_modules\@babel\core\lib\config\config-chain.js:320:26)
at D:\miniapp\housing_pc\node_modules\@babel\core\lib\config\config-chain.js:283:7
at buildRootChain (D:\miniapp\housing_pc\node_modules\@babel\core\lib\config\config-chain.js:90:20)
at loadPrivatePartialConfig (D:\miniapp\housing_pc\node_modules\@babel\core\lib\config\partial.js:85:55)
at Object.loadPartialConfig (D:\miniapp\housing_pc\node_modules\@babel\core\lib\config\partial.js:110:18)
at Object.<anonymous> (D:\miniapp\housing_pc\node_modules\babel-loader\lib\index.js:140:26)
at Generator.next (<anonymous>)
at asyncGeneratorStep (D:\miniapp\housing_pc\node_modules\babel-loader\lib\index.js:3:103)
at _next (D:\miniapp\housing_pc\node_modules\babel-loader\lib\index.js:5:194)
at D:\miniapp\housing_pc\node_modules\babel-loader\lib\index.js:5:364
@ multi (webpack)-dev-server/client?http://192.168.0.152:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
does anyone know how to solve this?