Skip to content

Failed when turning off modules of ES2015 preset #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
liufei opened this issue Feb 11, 2017 · 5 comments
Open

Failed when turning off modules of ES2015 preset #10

liufei opened this issue Feb 11, 2017 · 5 comments

Comments

@liufei
Copy link

liufei commented Feb 11, 2017

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.

@liufei liufei changed the title Failed when turn off modules of ES2015 preset Failed when turning off modules of ES2015 preset Feb 12, 2017
@adrienharnay
Copy link

Bump, this plugin is great but is incompatible with Webpack 2 because of this

@rajatbarman
Copy link

rajatbarman commented Mar 31, 2017

Need support for {modules: false}.

@kendallroth
Copy link

kendallroth commented Jun 19, 2017

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!

@djfrsn
Copy link

djfrsn commented Jul 23, 2017

@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

@njgraf512
Copy link

Ran into this today. Is this package still maintained?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants