Closed otakustay closed 6 years ago
This seems entirely esoteric issue with no practical applications.
This would be a great feature. @gajus For a use-case, think of create-react-app
, where all the webpack and build configuration is abstracted away from the consumer...
@otakustay Did you find a way around this? What you explained is exactly what we are trying to do too...
Currently
babel-plugin-react-css-modules
requires to be installed as runtime dependency since it generates an import tobabel-plugin-react-css-modules/dist/browser/getClassName
In our case, we use a private package to encapsulate all babel plugins, we don't want our users to be aware to the
babel-plugin-react-css-modules
, neither do we want them to install it themselvesWe think a solution could be this plugin providing an option
runtimeModulePath
to identify this runtime helper module, for example when our private package isour-fe-tools
, we config it as:Then import statement is transformed to
import getClassName from 'our-fe-tools/lib/styleNameHelper'
so we can entirely encapsulate all babel plugins