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

Suggestion: Webpack require should resolve jsx by default #16

Closed
umbrae opened this Issue Jun 28, 2014 · 5 comments

Comments

Projects
None yet
6 participants
@umbrae

umbrae commented Jun 28, 2014

I had to add:

  resolve: {
    extensions: ['', '.js', '.jsx']
  },

To my webpack config so that jsx files could be easily require without being explicit about extension names. I'm still a noob at most of this but it seems like this may be handy for others.

@newtriks

This comment has been minimized.

Show comment
Hide comment
@newtriks

newtriks Jun 29, 2014

Member

Thanks @umbrae nice tip!

Member

newtriks commented Jun 29, 2014

Thanks @umbrae nice tip!

@sanketsahusoft

This comment has been minimized.

Show comment
Hide comment
@sanketsahusoft

sanketsahusoft Sep 9, 2014

Thanks! It helped me 👍

sanketsahusoft commented Sep 9, 2014

Thanks! It helped me 👍

@newtriks newtriks closed this Sep 25, 2014

@kswope

This comment has been minimized.

Show comment
Hide comment
@kswope

kswope Jul 22, 2015

👍 to more convention, less configuration

kswope commented Jul 22, 2015

👍 to more convention, less configuration

lotabout added a commit to lotabout/react-webpack-boilerplate that referenced this issue Mar 25, 2016

@Benno007

This comment has been minimized.

Show comment
Hide comment
@Benno007

Benno007 Dec 15, 2016

Using an empty extension in the array no longer works in the latest version of webpack (2.2.0). Anyone have a workaround?

Benno007 commented Dec 15, 2016

Using an empty extension in the array no longer works in the latest version of webpack (2.2.0). Anyone have a workaround?

@selbekk

This comment has been minimized.

Show comment
Hide comment
@selbekk

selbekk May 23, 2017

@Benno007 simply skip the empty extension:

resolve: {
  extensions: ['.js', '.jsx']
}

selbekk commented May 23, 2017

@Benno007 simply skip the empty extension:

resolve: {
  extensions: ['.js', '.jsx']
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment