After webpack+babel uses the transform-object-rest-spread plug-in, the size of the main.js file increases several times.

because the DatePicker in iviewui needs extension operations, but the size of the main.js file generated by adding the transform-object-rest-spread plug-in increases several times
.babelrc as follows

{
  "presets": ["env"],
  "plugins": [
    [
      "transform-object-rest-spread", //iviewui
      "import",
      {
        "libraryName": "iview",
        "libraryDirectory": "src/components"
      }

    ]
  ]
}

warn information is as follows

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (817 KiB)
      main.77c9e24ff58d4333e1a0.js

is there any way to reduce the file size?


I got it to 480kb
uninstall transform-object-rest-spread
install stage-3:npm install-- save-dev babel-preset-stage-3
.babelrc set "presets": ["env", "stage-3"],
ie10

Menu