babel-plugin-import
babel-plugin-import copied to clipboard
What is "libraryDirectory" referring to?
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 where you able to figure this out ?
Unfortunately I did not @mohitrajane. Ended up never having to use this plugin, so did not spend more time looking into it!
@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'
.