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

Webpack & ES6 & default react config #232

Open
hurano opened this issue Oct 9, 2017 · 3 comments
Open

Webpack & ES6 & default react config #232

hurano opened this issue Oct 9, 2017 · 3 comments

Comments

@hurano
Copy link

hurano commented Oct 9, 2017

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.

@nippur72
Copy link
Contributor

nippur72 commented Oct 9, 2017

I think it should be as easy as adding the rule in webpack.config.*.js:

rules: 
[
   ...
   { test: /\.rt$/, loader: "react-templates-loader?modules=es6" },
   ...
]

@hurano
Copy link
Author

hurano commented Oct 9, 2017

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

@nippur72
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants