gr2m / moment-parseformat

A moment.js plugin to extract the format of a date/time string
http://gr2m.github.io/moment-parseformat
Apache License 2.0
45 stars 30 forks source link

Library cannot be minified #35

Closed moses-seeq closed 8 years ago

moses-seeq commented 9 years ago

This library cannot be minified and concatenated with the rest of our dependencies, but when delivered unminified all works well.

gr2m commented 9 years ago

what do you use to minify? Can you try to minify this version: https://wzrd.in/standalone/moment-parseformat

moses-seeq commented 9 years ago

Unfortunately, I've not had any luck with this version either. We use usemin to minify. I thought at first that it might be caused by the lack of semi-colons, but that change alone has not resolved the problem either. Thanks for looking into it.

gr2m commented 9 years ago

@moses-seeq can you please check that you use latest version of usemin? If you are on latest version, can you check what npm package usemin is using internally for minification, and what version? Do you see any errors?

I've tested it with latest uglify-js version, and had no issues. I've pasted the output in the console on http://momentjs.com/docs/ and moment.parseFormat worked without problems.

gr2m commented 9 years ago

also, try to add a ; in the beginning and end:

;(function (root, factory) {
...
});
gr2m commented 8 years ago

can you try again? I've pushed a few updates https://wzrd.in/standalone/moment-parseformat

moses-seeq commented 8 years ago

I'm sorry to have taken so long to get back to you. I was unsuccessfully attempting to fit this between tasks so I finally created a new task for it. So far it appears to minify successfully in our environment. I'm going to run a few more tests, just to be sure. Is the link above the same as the recently released version?

Thank you!

gr2m commented 8 years ago

no worries @moses-seeq, I'm very thankful for the time you invest to report the bug and to help get it fixed :)

Yes, the link above always links to the latest released version

moses-seeq commented 8 years ago

Excellent! Further testing has all been successful. Thank you for taking care of this.

gr2m commented 8 years ago

:+1: