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

What is "libraryDirectory" referring to?

Open Bazze opened this issue 4 years ago • 3 comments

Hello!

I can't seem to find any documentation on what the libraryDirectory option actually refers to. What directory should it point to and why?

Thanks

Bazze avatar Feb 04 '21 10:02 Bazze

@Bazze where you able to figure this out ?

mohitrajane avatar Apr 26 '21 07:04 mohitrajane

Unfortunately I did not @mohitrajane. Ended up never having to use this plugin, so did not spend more time looking into it!

Bazze avatar Apr 26 '21 13:04 Bazze

@Bazze Hi~ libraryDirectory actually refers to which type of module do you want to use in your project. For antd there is ESM modules under directory antd/es/* and CJS modules under directory antd/lib/*. Normally, if you use import Button from 'antd', you should config libraryDirectory: 'es'. if you use const Button = require('antd'), you should use the default behavior libraryDirectory: 'lib'.

MinimalistYing avatar Jun 03 '21 09:06 MinimalistYing