Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bower] Only include the minified script file #217

Merged
merged 1 commit into from
May 2, 2014

Conversation

jackp
Copy link
Contributor

@jackp jackp commented May 1, 2014

With plugins like https://github.com/taptapship/wiredep, it will automatically include all files listed under main. To integrate properly with these types of plugins, only include one of the built javascript files.

daviferreira added a commit that referenced this pull request May 2, 2014
[bower] Only include the minified script file
@daviferreira daviferreira merged commit 1b3a5ea into yabwe:master May 2, 2014
@websirnik
Copy link
Contributor

I don't think this is the right approach. The best practice to include both versions of the script. For larger projects minified script might not be relevant at all. Build tools like Grunt/Gulp/Brunch take care of minification(for your project) in most cases where they present. cc: @daviferreira

@websirnik
Copy link
Contributor

@jackp I believe Wiredep have an option to specify which scipt file you want to use https://github.com/taptapship/wiredep#bower-overrides

@jackp
Copy link
Contributor Author

jackp commented May 2, 2014

I agree with you that that minified script might not be relevant, so I would change the suggestion to only include the non-minified script as part of main. I don’t quite understand why it is best practice to include both versions of the script though, as the library should only have one primary javascript endpoint (if it is a built file). http://bower.io/#defining-a-package
-- 
Jack Parker

On May 2, 2014 at 6:06:13 AM, Nikita Korotaev (notifications@github.com) wrote:

@jackp I believe Wiredep have an option to specify which scipt file you want to use https://github.com/taptapship/wiredep#bower-overrides


Reply to this email directly or view it on GitHub.

@daviferreira
Copy link
Member

Ok, I'm not a bower user, but I read the doc and it states the following:

The primary acting files necessary to use your package. While Bower does not directly use these files, they are listed with the commands bower list --json and bower list --paths, so they can be used by build tools.

  • Preprocessor files like CoffeeScript should be compiled.
  • Do not include minified files.
  • Files names should not be versioned (Bad: package.1.1.0.js; Good: package.js).

I'm gonna change it and generate a non-minified css file aswell.

My only doubt now is about the theme files. Should they be included on the main property?

@jackp
Copy link
Contributor Author

jackp commented May 2, 2014

I'd say no. Typically this main property is used for "plug-and-play" functionality in build tools. So I'd just put whatever files are necessary for the library to function. If someone wants to use an additional theme, then they can manually include it.

By the way, amazing tool. I absolutely love it.

nysk pushed a commit to nysk/medium-editor that referenced this pull request Aug 10, 2015
[bower] Only include the minified script file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants