babel-plugin-wrap-in-js icon indicating copy to clipboard operation
babel-plugin-wrap-in-js copied to clipboard

babelrc should be set to false for css files

Open JuanCaicedo opened this issue 7 years ago • 2 comments

I had a some problems adding react-dates to a project that seem to stem from wrap-in-js. @ljharb seems to think that they can be solved by telling this plugin to ignore the .babelrc that it finds inside the modules being imported.

I'm having a little trouble figuring out how to configure that inside a plugin. Everything I can find seems to be about setting it when you initiate a transformation. Should this plugin mutate the babel that gets passed to it here? That seems a little strange

JuanCaicedo avatar Nov 07 '17 09:11 JuanCaicedo

The work around I did was to take the css file that I'm trying to import outside of node_modules and to put it in my styles directory, so that it's far away from it's .babelrc, but this isn't a very nice solution

JuanCaicedo avatar Nov 07 '17 10:11 JuanCaicedo

I installed below packages to fix this issue.

npm install --save-dev babel-plugin-inline-react-svg npm i babel-plugin-transform-replace-object-assign npm i babel-preset-airbnb --save-dev

AtanuMandal avatar May 16 '18 02:05 AtanuMandal