Webpack & ES6 & default react config
hurano opened this issue · 3 comments
Is there any way we can use the default react webpack config to make react-templates works?
https://reactjs.org/docs/installation.html#creating-a-new-application
I would like to modify webpack config after I run this command.
$npm run eject
Thanks.
I think it should be as easy as adding the rule in webpack.config.*.js
:
rules:
[
...
{ test: /\.rt$/, loader: "react-templates-loader?modules=es6" },
...
]
I tired but it didn't work correctly.
I am getting some error.
App.js:6 Uncaught TypeError: (0 , _App2.default) is not a function
The source is here.
https://github.com/hurano/react-sass-template/tree/template
I cloned the repo and tried to fix it, but I'm unable to locate the problem.
Apparently webpack
is not resolving the line:
import App from './js/App';
but it's leaving it untouched, and thus App.js
is not included in the bundle (and rt
not being called).
Tip: you can debug which files are processed by the loaders by chaining echo-loader.