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 support #4

Open
aaronroberson opened this issue Sep 26, 2016 · 2 comments
Open

Webpack support #4

aaronroberson opened this issue Sep 26, 2016 · 2 comments

Comments

@aaronroberson
Copy link

Hello,

I'm trying to use this plugin within our Aurelia application. I'm using webpack as our bundler and have installed the aurelia-react-loader plugin via npm.

When I try to do the following:
<require from='@nike/frame-component-library/src/components/nav/Nav.js!react-component'></require>

I get an error stating that the file cannot be found. However, if I drop the !react-component suffix the file is found but I get an Unexpected token error due to the JSX.

Any help would be appreciated, thanks!

@bryanrsmith
Copy link
Owner

When I wrote this Webpack support in Aurelia was experimental, and I never got around to trying out the loader with it. I'd like to get it working, but I'm not sure when I'll have the time.

Are you able to import other resources without errors? One problem I see is the JSX thing. This loader doesn't run any transforms. You will need to compile any JSX with babel (probably via a webpack loader config) before running it through the react-component loader.

Sorry I don't have a better answer for you right now. If you discover any changes that could be made to better support webpack I'd be happy to take a PR.

@allencoded
Copy link

I am not using auelia-react-loader but I was able to make react work with Webpack/Aurelia. I detailed how in my wiki.
https://github.com/allencoded/aurelia-react-skeleton/wiki/Aurelia-with-React-using-Webpack

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

3 participants