You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ option | values | default
34
34
`doctype` | any string that can be used as [a doctype](http://en.wikipedia.org/wiki/Document_type_declaration), this will be prepended to your document | `"<!DOCTYPE html>"`
35
35
`beautify` | `true`: beautify markup before outputting (note, this can affect rendering due to additional whitespace) | `false`
36
36
`transformViews` | `true`: use `babel` to apply JSX, ESNext transforms to views.<br>**Note:** if already using `babel-register` in your project, you should set this to `false` | `true`
37
-
`babel` | any object containing valid Babel options<br>**Note:** does not merge with defaults | `{presets: ['react', 'es2015']}`
37
+
`babel` | any object containing valid Babel options<br>**Note:** does not merge with defaults | `{presets: ['react', [ "env", {"targets": {"node": "current"}}]]}`
38
38
39
39
The defaults are sane, but just in case you want to change something, here's how it would look:
Under the hood, [Babel][babel] is used to compile your views into ES5 friendly code, using the [react][babel-preset-react] and [es2015][babel-preset-es2015] presets by default. Only the files in your `views` directory (i.e. `app.set('views', __dirname + '/views')`) will be compiled.
49
+
Under the hood, [Babel][babel] is used to compile your views to code compatible with your current node version, using the [react][babel-preset-react] and [env][babel-preset-env] presets by default. Only the files in your `views` directory (i.e. `app.set('views', __dirname + '/views')`) will be compiled.
50
50
51
51
Your views should be node modules that export a React component. Let's assume you have this file in `views/index.jsx`:
52
52
@@ -156,11 +156,17 @@ All "locals" are exposed to your view in `this.props`. These should work identic
156
156
157
157
* It's not possible to specify a doctype in JSX. You can override the default HTML5 doctype in the options.
0 commit comments