Skip to content
This repository was archived by the owner on Oct 24, 2021. It is now read-only.

Commit b708cca

Browse files
committed
Improving format of modules.md
1 parent 9678079 commit b708cca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/packages/modules.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@ Any non-js resource outside of imports (and some other special folders) are stil
2222
2323
## Enabling modules
2424

25-
We think you’re going to love the new module system, and that's why it will be installed by default for all new apps and packages. Nevertheless, the `modules` package is totally optional, and it will be up to you to add it to existing apps and/or packages.
25+
It is installed by default for all new apps and packages. Nevertheless, the `modules` package is totally optional.
26+
27+
If you want to add it to existent apps or packages:
2628

2729
For apps, this is as easy as `meteor add modules`, or (even better) `meteor add ecmascript`, since the `ecmascript` package *implies* the `modules` package.
2830

2931
For packages, you can enable `modules` by adding `api.use('modules')` to the `Package.onUse` or `Package.onTest` sections of your `package.js` file.
3032

3133
Now, you might be wondering what good the `modules` package is without the `ecmascript` package, since `ecmascript` enables `import` and `export` syntax. By itself, the `modules` package provides the CommonJS `require` and `exports` primitives that may be familiar if you’ve ever written Node code, and the `ecmascript` package simply compiles `import` and `export` statements to CommonJS. The `require` and `export` primitives also allow Node modules to run within Meteor application code without modification. Furthermore, keeping `modules` separate allows us to use `require` and `exports` in places where using `ecmascript` is tricky, such as the implementation of the `ecmascript` package itself.
3234

33-
While the `modules` package is useful by itself, we very much encourage using the `ecmascript` package (and thus `import` and `export`) instead of using `require` and `exports` directly. If you need convincing, heres a presentation that explains the differences: http://benjamn.github.io/empirenode-2015
35+
While the `modules` package is useful by itself, we very much encourage using the `ecmascript` package (and thus `import` and `export`) instead of using `require` and `exports` directly. If you need convincing, here's a [presentation](http://benjamn.github.io/empirenode-2015) that explains the differences.
3436

3537
## Basic syntax
3638

0 commit comments

Comments
 (0)