generator-gulp-angular icon indicating copy to clipboard operation
generator-gulp-angular copied to clipboard

jquery not injected into html

Open jmls opened this issue 9 years ago • 5 comments

no matter how hard I try, I cannot seem to get jquery injected into my html

All the other libs (like jointjs) are injected ok.

it's defined in the bower.json file, it exists in bower_components, there is a bower.json file in the jquery directory with a main pointing to jquery.js.

What am I missing ?

jmls avatar Jan 24 '16 11:01 jmls

Find some exclude file in gulp tasks. It could happen if you have not selected this option during the generation process.

labrute avatar Jan 25 '16 07:01 labrute

For me, the problem was in gulp/conf.js:

// something something something
exports.wiredep = {
  exclude: [/jquery/],
  directory: 'bower_components'
};
// blah blah blah

Remove /jquery/ from there and you'll (hopefully) be golden.

ghost avatar Jan 26 '16 12:01 ghost

Is there a stated reason why /jquery/ is explicitly excluded in the gulp conf? Even if we select that we don't want jQuery in the initial setup phase, I don't know why it wouldn't just not install it, rather than creating a permanent exclusion hidden in some conf file. If you want to add jQuery later (as in our case) this is a very silly bug to try and track down.

c-johnson avatar Feb 06 '16 01:02 c-johnson

It's in bower dependency of Angular. That's why we have it and exclude it. The other solution would be to abuse of the bower override configuration but I didn't feel this as the right solution.

Swiip avatar Feb 06 '16 07:02 Swiip

Sorry for my EN. Guys it's not a deal to fix that way. I can't understand how is it possible jquery to be included when it is not available (not installed) in bower deps? I've tried it and noticed that there is no reason to exclude it in conf.js. Am i wrong?

VishneviyMazhor avatar Jun 27 '16 15:06 VishneviyMazhor