-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Bower install jquery-mobile #7554
Comments
Here is another one I did from bower_components/jquery-mobile
Running "requirejs:js" (requirejs) task
I believe this is due that bower.json ignores build folder where those assets are located for requirejs |
We should add some info about Bower to the readme. |
@ganchenkor: The bits we ship on bower are the AMD micro-modules. It is not useable from a script tag. You need an AMD loader to use them. This will allow you to pick and choose yourself the components from jQuery Mobile you want to use in your project and the AMD loader will resolve the dependencies for you. If you're looking for a custom build usable in a script tag please go to: http://jquerymobile.com/download-builder/ If you're looking at building it yourself you need to clone https://github.com/jquery/jquery-mobile, customize the jquery.mobile.js and use our build system to build your custom version of jQM. |
Closed #7554 |
Which means using bower install jquery-mobile is totally useless and I have yo actually clone repo to build it. What is the point of having bower than? |
I just explained you how to use jQuery Mobile as a bower component. I'm not sure what's unclear to you but if you do ask respectfully I can give you more details on how to use it. |
Please, I can't figure out how to make it work using bower. Would really appreciate any of your help |
What I tried is
|
I do respect any of your work. Jqm is awesome product! |
That won't work, the bower component is not meant to be built with our build system. If you want to use our build system, you're welcome to but for that you need to clone the repo. |
Then if for instance you want to use jQM's select widget, your index file should contain something like that: <script src="./bower_components/requirejs/require.js"></script>
<script>
requirejs.config({
paths: {
"jquery": "./bower_components/jquery/jquery",
"jquery-mobile": "./bower_components/jquery-mobile"
}
});
require( [ "jquery", "jquery-mobile/widgets/forms/select" ], function( $ ) {
require( [ "jquery-mobile/init" ], function() {
// Do something fancy with the jQM select
});
});
</script> Note: I haven't tested that code but this should help you understand what's required to use jQuery Mobile when importing it with Bower. |
Thank you so much for explaining that, I'll try and let you know |
Came into the same issue, not being familiar myself with RequireJS. I also thought the bower would let me use JQM similarly to other Bower packages just including it. Maybe not that fancy, but for simplicity I ended up using the custom https://github.com/jobrapido/jquery-mobile-bower |
@ivansabik that is also exactly what I need. Thank you! |
@ganchenkor, @ivansabik, @evisong I used Grunt only few times, so maybe my solution is not the best, but it works :-) I'm not convinced to use Here's an example module.exports = function (grunt) {
grunt.initConfig({
clean: {
jquerymobile: 'bower_components/jquery-mobile'
},
gitclone: {
jquerymobile: {
options: {
repository: 'https://github.com/jquery/jquery-mobile.git',
branch: 'master',
directory: 'bower_components/jquery-mobile'
}
}
},
run: {
options: {
cwd: "bower_components/jquery-mobile"
},
jquerymobile_npm_install: {
cmd: "npm",
args: [
'install'
]
},
jquerymobile_grunt: {
cmd: "grunt"
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-git');
grunt.loadNpmTasks('grunt-run');
grunt.registerTask('default', [
'clean',
'gitclone',
'run'
]);
}; |
I have some confusion on this.
In master branch bower.json has
when I do fetch
it downloads 1.4.3 version, so my first question would be
1)How do I download 1.5.0pre version usign bower (I tried to append #1.5.0pre - didn't work)
I have no idea where is it fetching from, because my guess it should trigger from master branch
here is output
2)After installing using bower and referencing this way:
And I still get an error about
Because I believe I should go into the folder bower_components/jquery-mobile and do
but it also doens't work
grunt gives me an error
I also believe if we use bower for jquery-mobile it should already be built without using npm install && grunt
The text was updated successfully, but these errors were encountered: