jensarps / AMD-feature

A loader plugin for AMD loaders
Other
161 stars 10 forks source link

feature.js 404 (Not Found) #8

Closed drewwells closed 10 years ago

drewwells commented 10 years ago

After building my project with r.js, I get 404 (Not Found) for feature.js.

The only way that I have seen to fix this is to explicitly include feature as a dependency before calling feature!. This isn't suitable for most usages of feature!.

There doesn't seem to be anything in the optimization documentation explaining how to include a loader into the built assets. Perhaps something else is wrong?

jensarps commented 10 years ago

Hm, that's weird. Usually, r.js includes all dependencies in the build, and plugins are dependencies, too. I assume everything goes fine when using the un-built version of your project? What is the r.js version you're using to build? Did you specify a path to the feature plugin?

drewwells commented 10 years ago

I use a paths for feature, but also tried it without the paths in the default appDir... same problem. I'm using r.js 2.1.5. I agree this is really weird. Does it need to be explicitly defined in our build.json?

jensarps commented 10 years ago

Nope, it should work out of the box. Usually, r.js should start at the entry point, then somewhere find a feature!something requirement and understand it needs to include the feature plugin.

I'll check if the examples build fine with r.js 2.1.5 (currently using 2.1.1)

drewwells commented 10 years ago

Actually I know why this is broken. These are require() calls done programmatically rather than as part of the define/require block at the top of the file. So obviously r.js wouldn't include feature! Sorry about that.

jensarps commented 10 years ago

Ah, ok, I see :)