Skip to content
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
Copy Markdown
Contributor

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?

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
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