-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
main
property in bower.json
#393
Comments
What files do I need to include in order for this package to work? Use caseDraggabilly has several dependencies. To build a packaged version of the script, which includes all the necessary dependencies, I use |
+1 Using it should enable tooling to know the essential files needed to make this component work. For example: today I wanted to use the |
+1 to allowing for separate "chunks" or modules that have js/css defined independently. I always thought it was a bummer (and not useful for our internal projects) to only be able to put one css file and one js file into |
I put a related in #367 (comment), which I'll copy here:
|
Another wrinkle here is that some components have specific build requirements. For example, angular scripts cannot survive obfuscation. As a component consumer, I would like to see errors point to raw source files rather than minified junk. But as a component developer, I may be the only one that knows how to optimally build my scripts. |
Heres the syntax that I suggested in 110 |
I'm currently using bower-installer from @blittle to use Bower, it only install the files listed on the main property and it is working like a charm. The proposal from spec and @benschwarz suggestion are really good for two reasons: creating one repo for many components distributions and breaking up minified files from not minified. Mainly the later, because it solves the problem from @jdeal and solves my problem which is: some of my projects just needs the minified version. Another opinion, that I still don't know if it's a good idea, but I think all the main files should be inside a "dist" directory. |
Also, +1 removing ignore. |
Why does Bower support only one file of each type in "main"? |
As per the spec for Bower, don't include minified files for `main` property, (and especially not both!) See bower/bower#393 for more. In real-world use, I use a build script that uses the main property, and this fix fixes an error that includes both versions of the file where I would only want the min file.
Bower [recommends](bower/bower#393) not to use minified files for your main scripts (leave it up to build tools to minify if desired). ``` 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 map and bower list --sources, so they can be used by build tools. Do not include minified files. Files should not be versioned (Bad: package.1.1.0.js; Good: package.js). ```
This one is still pretty ambiguous and the there hasn't been enough discussion in the spec, so bringing it out here.
See the spec and #46 for previous discussions.
Background
Right now it works naively and is just a field bower uses in eg.
bower ls --sources
, to feed other tools with paths from the field.Current spec description:
Proposal from spec
The spec currently contains a proposal, just going to leave it here, but don't focus just on it:
Discussion
Instead of starting with what it should do, we should start by identifying current and potential consumers and real-world use-cases, and go from there.
Some other questions that eventually needs answering:
The text was updated successfully, but these errors were encountered: