Software Archive
Read-only legacy content
17061 Discussions

xdk bower support is adding packages I dont want or need

Roi_D_
New Contributor I
634 Views

Latest version of XDK added bower support which is really annoying and making my package have lots of redundant files.

It adds all bower packages I use to the www folder and adds it to the built package. this is bad.

My www folder have only one app.js file which I pre-merge with all third party js I use. so my app.js already contains everything.

XDK adds bower_packages folder inside the www folder with all those third party which I don't actually need there and I didn't request from XDK to do it.

please fix. I can't publish packages with all those redundant files and external libs which just adds garbage to the final package.

 

0 Kudos
11 Replies
Roi_D_
New Contributor I
634 Views

I dont even see an option to disable this behavior in settings. why to add features which can't be turned off.

 

0 Kudos
Roi_D_
New Contributor I
634 Views

workaround I currently do: delete bower_packages folder (or make sure its not re-added) before each build. xdk will not add it again pre upload of the package.

 

 

0 Kudos
PaulF_IntelCorp
Employee
634 Views

Roi -- since your JS files are being loaded directly from the filesystem, it's not necessary to combine all of your JS files into one. You're not performing any network calls, so there is no network penalty for loading multiple JS files in your app. This is one of the differences between a Cordova app and a web app, there is no web server and the network is an optional component.

0 Kudos
Roi_D_
New Contributor I
634 Views

but i still would like to do it and I minifiy it.

even without joining and minifying. pulling out all bower repos has additional sources I dont need. from each bower repo i only need the distribute js and not all the sources/docs/etc. so intel xdk actually pollutes the end package.

 

0 Kudos
PaulF_IntelCorp
Employee
634 Views

Yes, I've seen similar behavior if you install jQuery with Bower. It has to do with the way some of the Bower repos are assembled. For example, see these instructions from the jQuery site regarding installation of jQuery via Bower > https://jquery.com/download/#downloading-jquery-using-bower. We have no control over the contents of the Bower repos.

Unfortunately, the XDK interface for Bower doesn't allow for customization of the Bower command-line, I'll see what can be done to accommodate that. Until then, your options are to delete the excess or use Bower from the command-line (the implementation in the XDK does not prevent you from using Bower at the command-line, as well, they are compatible).

0 Kudos
Roi_D_
New Contributor I
634 Views

I want to use bower and it works fine for me with gulp build and so on. but XDK still interfere me by downloading bower repos into the www folder without asking me. XDK should have an option to disable this behavior.

 

 

 

0 Kudos
PaulF_IntelCorp
Employee
634 Views

The XDK does not automatically download any Bower packages. It only runs Bower when you use the Bower management panel. Are you sure it is the XDK that is auto-updating your bower_components directory? Perhaps it is Gulp causing Bower to run?

CORRECTION:

  • if you delete the bower_components folder while the XDK is closed,
  • if you modify the bower.json file externally, while the XDK is closed, 

...then, the next time the XDK opens your project the Bower tool built into the XDK will automatically fetch the bower packages and add them to the www/bower_com folder (it will try to synchronize what you have defined in your bower.json file).

0 Kudos
Roi_D_
New Contributor I
634 Views

yes I'm sure it's the XDK.

my bower configuration is to download packages into folder app/bower_packages. XDK downloads it into www/bower_packages.

when I delete www/bower_packages and xdk is closed it's not being created by some other application.

when I open XDK it says it's synchronizing bower packages. this is when the www/bower_packages is created.

it happens only when starting the xdk. as long as i keep xdk open and delete the folder xdk won't download again. reopening the xdk downloads the packages again.

here is a screenshot from the xdk when it's downloading bower packages.

http://prntscr.com/9stxdm

 

then, the next time the XDK opens your project the Bower tool built into the XDK will automatically fetch the bower packages and add them to the www/bower_com folder (it will try to synchronize what you have defined in your bower.json file).

- so this is not what i want. i want to manage my bower packages myself. xdk downloads and use everything and doesn't know what i want

0 Kudos
PaulF_IntelCorp
Employee
634 Views

We had a meeting this morning to go over how to resolve this in the next release of the XDK. The problem is now well understood by the responsible engineer, who is working on fixing the issue you are experiencing and adding a few other Bower-related features that you should find beneficial. Until then, I don't have any other workarounds for you, other than what you have already discovered. I asked if there was a patch that could be provided to you that would disable the Bower component in the XDK, but there is nothing like that available. The only other workaround would be to use the prior release of the product, which I can get to you if you want to take that route.

BTW - there will be a hotfix released very soon to fix an urgent issue with false-positive anti-virus detection, that hotfix release will NOT include any feature changes, just a fix to eliminate this false-positive detection problem.

0 Kudos
Ashley_O_
Beginner
634 Views

 Hi, any news about this? I also would like to disable the bower sync... or choose the path it saves, by this I mean not under /www

0 Kudos
PaulF_IntelCorp
Employee
634 Views

This issue is addressed in the next release, which will be available in the very near future. I cannot provide an exact date of availability due to company policy. We are testing release candidates now.

0 Kudos
Reply