babel-plugin-import icon indicating copy to clipboard operation
babel-plugin-import copied to clipboard

this plugin will duplicate import modularly, at last the size is huge too.

Open happypandaa opened this issue 6 years ago • 4 comments

use this plugin the file is more the size is biger.

one normal page. If i use CDN and set externals. the size (compressed) about 60kb-70kb. use this plugin , the size (compressed) about 800kb . i try comment some modularly, the size is reduce .

`

        {
       test: /\.js$/,
        loader: 'babel-loader',
        exclude: /node_modules/,
        query: {
          presets: [
            'es2015', "react"
          ],
          plugins: [
           [
             "import", {
               "libraryName": "antd"
             }
           ]
         ]
        }
      }`

happypandaa avatar Oct 27 '17 09:10 happypandaa

after upgrade babel-plugin-import from 1.2.1 to 1.6.2

the output:

snipaste_2017-12-19_10-37-24

the number of reference is equal to the times of Col used in the compoent

yunxifd avatar Dec 19 '17 02:12 yunxifd

@yunxifd I have the same issue, did you have a chance to solve this with latest version, or you rolled version back to 1.2.1?

Thanks

osadchiynikita avatar Mar 27 '18 15:03 osadchiynikita

@osadchiynikita sorry ,I have not solve the problem.

yunxifd avatar Mar 28 '18 02:03 yunxifd

@yunxifd thanks for answer! Seems like rollback to 1.2.1 might be solution for now

osadchiynikita avatar Mar 28 '18 07:03 osadchiynikita