Skip to content
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

Add support for 'jsx' extensions #18

Merged
merged 1 commit into from
Apr 4, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/server/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const config = {
module: {
loaders: [
{
test: /\.js$/,
test: /\.jsx?$/,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope we need to add .js as well. Does this support it as well?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex will match both .js and .jsx. The ? makes the x optional.

http://regexr.com/3d4vm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. As said by @levithomason, this pattern optionally matches the last letter "x". So it matches both ".js" and ".jsx"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super. Didn't read that. Thanks guys.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!!!

loader: 'babel',
query: { presets: ['react', 'es2015', 'stage-2'] },
exclude: [path.resolve('./node_modules'), path.resolve(__dirname, 'node_modules')],
Expand Down