Mohamed Shaaban 9b1370f3d6 Add support to configure viewport addon
- By default, viewport addon is reading both initial viewports' set and default viewport from
`INITIAL_VIEWPORTS` and `DEFAULT_VIEWPORT` respectively which are exported by the addon
 - `configure` function is exported which accepts an object with `defaultViewport` and `viewports`
 - Change the default viewport by setting `defaultViewport` property to the key of the viewport (e.g. `configure({ defaultViewport: 'iphone5' })`)
 - Replace the entire viewports by setting brand new viewports to `viewports` property (e.g. `configure({ viewports: { brandNewDevice: { ... } } })`)
 - Add custom viewports by first merging both the `INITIAL_VIEWPORTS` and your custom viewports, and then pass the result as `viewports` to configure function
2018-03-20 00:50:22 +01:00

6 lines
191 B
JavaScript

const preview = require('./dist/preview');
exports.configure = preview.configure;
exports.DEFAULT_VIEWPORT = preview.DEFAULT_VIEWPORT;
exports.INITIAL_VIEWPORTS = preview.INITIAL_VIEWPORTS;