From 6c27b63195e1e4dd9258b20d054f36ac56f01cfe Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sat, 16 Nov 2019 05:58:05 +0800 Subject: [PATCH] Addon-viewports: Fix missing TypeScript types (#8848) Addon-viewports: Fix missing TypeScript types --- addons/viewport/package.json | 3 ++- addons/viewport/preview.js | 5 ----- addons/viewport/src/preview.ts | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 addons/viewport/preview.js create mode 100644 addons/viewport/src/preview.ts diff --git a/addons/viewport/package.json b/addons/viewport/package.json index 9c3816d33e5e..ca54026ceb43 100644 --- a/addons/viewport/package.json +++ b/addons/viewport/package.json @@ -23,7 +23,8 @@ "*.js", "*.d.ts" ], - "main": "preview.js", + "main": "dist/preview.js", + "types": "dist/preview.d.ts", "scripts": { "prepare": "node ../../scripts/prepare.js" }, diff --git a/addons/viewport/preview.js b/addons/viewport/preview.js deleted file mode 100644 index dc47e9c63cba..000000000000 --- a/addons/viewport/preview.js +++ /dev/null @@ -1,5 +0,0 @@ -const preview = require('./dist/legacy_preview/index'); - -exports.configureViewport = preview.configureViewport; -exports.DEFAULT_VIEWPORT = preview.DEFAULT_VIEWPORT; -exports.INITIAL_VIEWPORTS = preview.INITIAL_VIEWPORTS; diff --git a/addons/viewport/src/preview.ts b/addons/viewport/src/preview.ts new file mode 100644 index 000000000000..be2dc03d34c4 --- /dev/null +++ b/addons/viewport/src/preview.ts @@ -0,0 +1 @@ +export { configureViewport, DEFAULT_VIEWPORT, INITIAL_VIEWPORTS } from './legacy_preview';