survivejs / webpack-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/webpack/
2.42k stars 319 forks source link

Loading assets - Loading JSX #88

Closed brandonfujii closed 8 years ago

brandonfujii commented 8 years ago

I've been following along with the survivejs webpack book and my code can be found here. I'm having trouble transforming .jsx/es6 formatted files. I defined a function in /libs/parts.js that defines my babel loader and I refer to them in my webpack.config.js file, passing in a specific path. When I run my code with the dev-server, I receive no errors. However, when I perform npm run build, the error tells me that I need an appropriate loader to handle this file type.

Can anyone shed some light on this issue? I may have completely missed an important concept, as I'm just learning.

bebraw commented 8 years ago

Hi Brandon,

Looks like parts.loadJSX(PATHS.build) is the problem. I think it should be parts.loadJSX(PATHS.app) instead so it will traverse your application files.

Let me know how it goes!

brandonfujii commented 8 years ago

That did it, thanks!