Closed NoMaillard closed 8 years ago
can you use npm
to install instead of bower
?
After installing with npm, you can add the built file from node_modules/moment-parseformat/dist/moment-parseformat.js
.
Or if you want to install it via bower, try bower install https://npmcdn.com/moment-parseformat/dist/moment-parseformat.js
Unfortunately, i can't use npm
, we use gulp-wiredep
and it can not see that the bower version is installed, and yes i have run bower with --save
Error: Error: moment-parseformat is not installed. Try running `bower install`.
I’m sorry I don’t know how to work around that, I don’t know much about bower, do you have an idea? Can we somehow point bower install moment-parseformat
to install from bower install https://npmcdn.com/moment-parseformat/dist/moment-parseformat.js
?
you have to run npm build
when you update the package, and then add a bower.json
that points to dist/moment-parseformat.js
Is it enough to have the bower.json and dist/moment-parseformat.js on npm only though? I do not want to commit the dist
folder on github
i don't know, but if you look at other packages (momentjs
included) they all commit the dist to github. you can easily automate it with gulp
yes, I know, they do it only because of bower, but it comes with overhead that I cannot add in order to be able to maintain this package, I’m sincerely sorry
alright, thanks anyways...
in your bower.json, can you set a url instead of a version? Something like this
{
"name": "test",
"dependencies": {
"moment-parseformat": "https://npmcdn.com/moment-parseformat/dist/moment-parseformat.js"
}
}
You can also set a specific version like this "https://npmcdn.com/moment-parseformat@2.1.3/dist/moment-parseformat.js"
no i get :
moment-parseformat is not installed. Try running `bower install`.
so this works for me with bower 1.5.2
bower_components/moment-parseformat/index.js
and paste it directly into the console on momentjs.com. moment.parseFormat
is workingyes, but i have a gulp script running that injects automatically in the index.html, and that doesn't work, i think i found a workaround though
@gr2m my workaround didn't work, how about i submit a pull request that allows bower install
?
only thing you have to do more is npm run build
and bump the versions
the versions get bumped automatically with semantic-release. But as I said before, I will not commit built files to GitHub. But you can do it on a fork?
ah i see. well i would have tried, i'll work off a fork then
@gr2m thanks for this great tool ! however, it does not work in the browser... 😢 i did `bower install moment-parse-format --save' and the console would show require is not defined.
Simple way to fix it is to put the whole thing in an iife