Skip to content

Commit

Permalink
Merge pull request bower#43 from bower/main-entry-point
Browse files Browse the repository at this point in the history
Define main as the entry-point files, one-per-filetype
  • Loading branch information
desandro committed Apr 24, 2015
2 parents a531cc3 + da21ba9 commit 0b34d2b
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions README.md
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

0 comments on commit 0b34d2b

Please sign in to comment.