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

Define main as the entry-point files, one-per-filetype #43

Merged
merged 2 commits into from
Apr 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,49 @@ The package's semantic version number.
*Recommended*
Type: `String` or `Array` of `String`

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.
The entry-point files necessary to use your package. Only one file per filetype.

Entry-point files have module exports and may use module imports. While Bower does not directly use `main` files, they are listed with the commands `bower list --json` and `bower list --paths`, so they can be used by build tools.

Let's say your package looks like this:

package
js/
motion.js
run.js
walk.js
sass/
motion.scss
run.scss
walk.scss
img/
motion.png
walk.png
run.png
fonts/
icons.woff2
icons.woff
dist/
movement.js
movement.min.js
movement.css
movement.min.css

`motion.js` has module imports for `run.js` and `walk.js`. `motion.scss` has module imports for `run.scss` and `walk.scss`. `main` would be

* Preprocessor files like CoffeeScript should be compiled.
```
"main": [
"js/motion.js",
"sass/motion.scss",
]
```

Image and font files may be used or referenced within the JS or Sass files, but are not `main` files as they are not entry-points.

* Use source files with module exports and imports over pre-built distribution files.
* Do not include minified files.
* Filenames should not be versioned (Bad: package.1.1.0.js; Good: package.js).
* Filenames should not be versioned (Bad: `package.1.1.0.js`; Good: `package.js`).
* Globs like `js/*.js` are not allowed.

### moduleType

Expand Down