babel-plugin-transform-react-jsx-img-import
babel-plugin-transform-react-jsx-img-import copied to clipboard
Failed when turning off modules of ES2015 preset
Thanks for the great plugin.
It does work with this config,
{
"presets": [
"es2015",
"react"
],
"plugins": [
"react-hot-loader/babel",
"transform-runtime",
"transform-react-jsx-img-import"
]
}
but attribute of src is missing when turning off modules of ES2015 preset.
{
"presets": [
["es2015", { "modules": false }],
"react"
],
"plugins": [
"react-hot-loader/babel",
"transform-runtime",
"transform-react-jsx-img-import"
]
}
Below are versions of related packages:
"dependencies": {
"react": "^15.3.2",
"react-dom": "^15.3.2"
},
"devDependencies": {
"babel-core": "^6.22.1",
"babel-loader": "^6.2.10",
"babel-plugin-transform-react-jsx-img-import": "^0.1.4",
"babel-preset-es2015": "^6.18.0",
"webpack": "^2.2.1",
"webpack-dev-server": "^2.3.0"
}
How to solve this problem? Thanks.
Bump, this plugin is great but is incompatible with Webpack 2 because of this
Need support for {modules: false}.
I agree. I really enjoy the simplicity that this brings but unfortunately this is a deal-breaker for me at this time. While it is not too difficult to import
everything as necessary, being able to use <img src="@assets/images/small.jpg" />
(where @assets
is a Webpack alias) is much better!
@kendallroth, I'm going to give this a shot for dynamic imports for the time being. https://medium.com/@bogdan_plieshka/loading-static-and-dynamic-images-with-webpack-8a933e82cb1e
Ran into this today. Is this package still maintained?