Skip to content

Commit

Permalink
Merge pull request #95 from ankeetmaini/document-config-array-promise
Browse files Browse the repository at this point in the history
Documents exporting array, Promise from config. Fixes #69.
  • Loading branch information
lukastaegert authored Nov 25, 2017
2 parents 87d06f5 + 2b5bb48 commit c216a70
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ public/guide-summary
public/examples
public/service-worker*
server/routes
server/components
server/components
npm-debug.log
38 changes: 37 additions & 1 deletion guide/en/03-command-line-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,42 @@ export default {
};
```

You can also export an array from your **config** file to build several different bundles at once, even in watch mode.

```javascript
// rollup.config.js (exporting an array)
export default [{
input: 'main.js',
output: {
file: 'dist/bundle1.js',
format: 'cjs'
}
}, {
input: 'main.js',
output: {
file: 'dist/bundle2.js',
format: 'iife'
}
}];
```

Want to read your config async? No problem! Rollup can also handle a `Promise` which resolves to an object or an array.

```javascript
// rollup.config.js
export default fetch('/some-remote-service-or-file-which-returns-actual-config');
```

Similarly, you can do this as well,

```javascript
// rollup.config.js (Promise resolving an array)
export default Promise.all([
fetch('get-config-1'),
fetch('get-config-2')
])
```

You *must* use a configuration file in order to do any of the following:

- bundle one project into multiple output files
Expand Down Expand Up @@ -110,4 +146,4 @@ Rebuild the bundle when its source files change on disk.

#### `--silent`

Don't print warnings to the console.
Don't print warnings to the console.
11 changes: 8 additions & 3 deletions public/codemirror.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@
.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}

.cm-fat-cursor-mark {
background-color: rgba(20, 255, 20, 0.5);
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
}
.cm-animate-fat-cursor {
width: auto;
border: 0;
Expand Down Expand Up @@ -140,8 +145,8 @@

/* Default styles for common addons */

div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
.CodeMirror-activeline-background {background: #e8f2ff;}

Expand Down

0 comments on commit c216a70

Please sign in to comment.