Skip to content

Commit

Permalink
Merge pull request #131 from Financial-Times/n-ui-configuration-docs
Browse files Browse the repository at this point in the history
Document how to configure `n-ui` to support `x-engine` .jsx files on the client side
  • Loading branch information
i-like-robots authored Aug 24, 2018
2 parents 799f38b + 2ee3dcb commit a439878
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/x-engine/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,26 @@ export default const TeaserList = (props) => (
);
```

#### Client-side through n-ui
In order to configure n-ui to compile x-dash based `.jsx` files you will also need to add the following to `n-ui-build.config.js`.

```js
// n-ui-build.config.js
const xEngine = require('@financial-times/x-engine/src/webpack');

module.exports = {
plugins: [
xEngine()
],
pragma: 'h'
};
```

You will also need to import `h` from `x-engine` at the top of each `.jsx` file.
```javascript
import {h} from '@financial-times/x-engine'
```

## FAQ

### This sounds complicated… is it a magic black box?
Expand Down

0 comments on commit a439878

Please sign in to comment.