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

jQuery missing? #206

Closed
pikeas opened this issue Oct 10, 2014 · 9 comments
Closed

jQuery missing? #206

pikeas opened this issue Oct 10, 2014 · 9 comments

Comments

@pikeas
Copy link

@pikeas pikeas commented Oct 10, 2014

New to yeoman, trying to get this generator working. I had this issue using the version on npm, as well as the version on GH (npm install -g git+https://git@github.com/yeoman/generator-gulp-webapp.git run within the past hour).

On a fresh install (yo gulp-webapp; bower install; npm install; gulp; gulp serve), the sample page is throwing errors in each of the Bootstrap JS files about jQuery being missing.

@silvenon
Copy link
Member

@silvenon silvenon commented Oct 10, 2014

Does gulp wiredep fix it?

@pikeas
Copy link
Author

@pikeas pikeas commented Oct 10, 2014

Yes, working now. Chalking it up to new user error. :-)

@pikeas pikeas closed this Oct 10, 2014
@pikeas
Copy link
Author

@pikeas pikeas commented Oct 10, 2014

But perhaps the wiredep task should be added as a dependency of the build task?

@pikeas pikeas reopened this Oct 10, 2014
@silvenon
Copy link
Member

@silvenon silvenon commented Oct 11, 2014

wiredep is already the part of watch task, so you shouldn't really have to call it manually, except in cases when you installed new Bower components while your watch task wasn't running. Making it a part of the build task doesn't make sense to me because you would already be missing those files while you were developing, so you would run it then.

If you strongly believe otherwise, I'd be happy to discuss it, but I'm closing this until there's a good reason for it.

@silvenon silvenon closed this Oct 11, 2014
@pikeas
Copy link
Author

@pikeas pikeas commented Oct 11, 2014

@silvenon Fair point, but consider the first use experience. jQuery has not yet been pulled, because it's a sub-dependency of Bootstrap and not listed in bower.json. So it will never be pulled in by the watch task - instead the user has to gulp wiredep manually.

@silvenon
Copy link
Member

@silvenon silvenon commented Oct 11, 2014

It is included in bower.json, I'm not sure why it's not in your case. But even if it wouldn't be, gulp wiredep is run as part of yo gulp-webapp, so Bootstrap's dependencies should be included as well. You also shouldn't have to do bower install and npm install after yo gulp-webapp, it is run automatically, unless you pass a --skip-install option.

@pikeas
Copy link
Author

@pikeas pikeas commented Oct 11, 2014

I just did the following:

npm install -g git+https://git@github.com/yeoman/generator-gulp-webapp.git
mkdir test; cd test;
yo gulp-webapp

Here's the bower.json which was created:

{
  "name": "test",
  "private": true,
  "dependencies": {
    "bootstrap-sass-official": "~3.2.0",
    "modernizr": "~2.8.1"
  }
}

The generator emits the following message: I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.

It did not run bower install or npm install automatically, so I ran them myself. The message doesn't suggest running gulp wiredep.

@silvenon
Copy link
Member

@silvenon silvenon commented Oct 11, 2014

This is a different issue, the problem is that the generator doesn't install dependencies. I'm also experiencing this. We'll merge #194 soon, which will fix this.

A dirty shortcut:

$ git clone https://github.com/silvenon/generator-gulp-webapp
$ cd generator-gulp-webapp
$ git checkout -b new
$ git pull origin new
$ npm link
$ cd ../test
$ yo gulp-webapp

Concerning tips like gulp wiredep, we'll take care of that with #121.

Let me know if you need any more help or explanation.

@silvenon
Copy link
Member

@silvenon silvenon commented Oct 15, 2014

It's merged, you can try installing from master again.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.