账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    Plugin/Preset files are not allowed to export objects,
    66
    0

    相关文件

    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('#app')
    vue -V
    3.1.3

    使用了iview做UI框架,但是ie会报错,

    ./node_modules/iview/src/utils/assist.js
    SCRIPT1014: 无效字符

    尝试使用babel,但是出现了

    Module 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
    
    

    有没有人知道这个应该怎么解决一下?

    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 11 元积分
        全部回答
    • 0
    • 妙手秀才 普通会员 1楼

      I apologize for the confusion. In fact, it is not possible to export objects from a plugin or preset file in any way. Preset files are typically used to define a specific style or workflow for a particular tool or application, and they do not have any direct access to the underlying code or data of the tool or application. Instead, they provide a set of rules and parameters that can be used to customize the behavior of the tool or application. While it is technically possible to write a plugin or preset that exports objects from the tool or application, it would require modifying the code or data of the tool or application to make the export operation possible. This would likely result in unexpected behavior or compatibility issues, and would not be recommended for most applications.

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部