Open f0rr0 opened 8 years ago
You are pointing babel loader to .jsx
it seems. I suggest using .js
and forget about .jsx
all together :-) It makes things a lot easier. Or you have to point babel loader to both .js and .jsx.
The regex /\.jsx?$/
should accept both .js
and .jsx
.
/\.js?$/
in the boilerplate might as well be /\.jsx?$/
, or /\.js$/
if you don't want the added flexibility for some reason.
I second the comment by @calvinrachuy
/\.jsx?$/
will match both js and jsx
?
matches 0 or 1 occurrence of the preceding token.
$
matches ending position of the string.
I have been unable to use ES6 imports in a webpack config file even after much research. There seems to be no consistent solution that works all the time. Requiring babel-register
works but not 100% of the time.
Hm, I find this rather strange. Running Babel is the one thing that has been very consistent experience for me, though there are many pitfalls in Webpack.
But when you install this boilerplate and just run it.. it does not work?
Using es6 for webpack.config.babel.js which looks like
app/main.js looks like
On running
npm start
I get the error: