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

Include requirejs and requirejs/text via NPM. #371

Closed
shaunluttin opened this issue Oct 10, 2016 · 7 comments
Closed

Include requirejs and requirejs/text via NPM. #371

shaunluttin opened this issue Oct 10, 2016 · 7 comments

Comments

@shaunluttin
Copy link
Contributor

shaunluttin commented Oct 10, 2016

Right now these are included in the scripts directory instead of letting NPM install them.

In the aurelia.json, please move from this:

"prepend": [                                                   
  "scripts/require.js"                                         
],                                                             
"dependencies": [                                              
{                                                            
  "name": "text",                                            
  "path": "../scripts/text"                                  
},                                                           

to this:

"prepend": [                                                   
  "node_modules/requirejs/require.js"                          
],                                                             
"dependencies": [                                              
  "text",                                                      

And add this to the package.json dependencies

"requirejs": "^2.3.2",
"text": "github:requirejs/text"
@EisenbergEffect
Copy link
Contributor

Sounds reasonable :) Is it not possible to get require.js from npm?

@shaunluttin
Copy link
Contributor Author

shaunluttin commented Oct 10, 2016

Yes. It is possible to get require.js from NPM. It is also possible to get requirejs/text from there too. The problem is that the aurelia-cli scaffolding does not do that, so we have to manually make the above changes.

@gheoan
Copy link
Contributor

gheoan commented Oct 10, 2016

Note that the text plugin is not in the npm registry, but can be obtained from github via npm. requirejs/text#122

@AStoker
Copy link
Contributor

AStoker commented Oct 10, 2016

Many of the people I've talked to have already replaced the included require and text loaders with the ones from npm. It seems simple enough to do and probably worth doing. Just have to modify the default aurelia.json file to load up those files, and include them in the default package.json

@shaunluttin
Copy link
Contributor Author

shaunluttin commented Oct 11, 2016

Many of the people I've talked to have already replaced the included require and text loaders with the ones from npm.

@AStoker That's what I do too. For one, it's a pain. For two, it's an inconsistent message to people learning Aureila; i.e. why are some libraries pulled from NPM but others placed in scripts, and thereby also in version control? I still don't know the answer.

It seems simple enough to do...

I hope you mean that it is simple enough for the Aurelia-CLI team and that you will do it. If you mean simple enough for users of Aurelia, then I for one can say that I did not find it simple to do.

@EisenbergEffect
Copy link
Contributor

I think we should fix this. It shouldn't be hard.

AStoker added a commit to AStoker/cli that referenced this issue Oct 24, 2016
Resolves: aurelia#371
Move RequireJS and the Text plugin into the node_modules so that
generated code is separated from library code.
@AStoker
Copy link
Contributor

AStoker commented Oct 24, 2016

@EisenbergEffect, how does this look: #391

AStoker added a commit to AStoker/cli that referenced this issue Oct 24, 2016
Resolves: aurelia#371
Move RequireJS and the Text plugin into the node_modules so that
generated code is separated from library code.
AStoker added a commit to AStoker/cli that referenced this issue Oct 26, 2016
Resolves: aurelia#371
Move RequireJS and the Text plugin into the node_modules so that
generated code is separated from library code.
AStoker added a commit to AStoker/cli that referenced this issue Nov 7, 2016
Resolves: aurelia#371
Move RequireJS and the Text plugin into the node_modules so that
generated code is separated from library code.
alpox pushed a commit to alpox/cli that referenced this issue Nov 29, 2016
Resolves: aurelia#371
Move RequireJS and the Text plugin into the node_modules so that
generated code is separated from library code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants