diff --git a/examples/js/index.js b/examples/js/index.js index b4e063b4..94c611c0 100644 --- a/examples/js/index.js +++ b/examples/js/index.js @@ -12,7 +12,6 @@ import { Slide, Deck, Text, - FitText, Grid, Box, Image, @@ -23,6 +22,7 @@ import { DefaultTemplate, SlideLayout } from 'spectacle'; +const FitText = Text; // TODO: NEED PUBLISH const formidableLogo = 'https://avatars2.githubusercontent.com/u/5078602?s=280&v=4'; diff --git a/examples/one-page/index.html b/examples/one-page/index.html index b7adc7c6..a6126a16 100644 --- a/examples/one-page/index.html +++ b/examples/one-page/index.html @@ -9,39 +9,40 @@
+ @@ -60,7 +61,6 @@ Slide, Deck, Text, - FitText, Grid, Box, Image, @@ -74,6 +74,8 @@ import htm from 'htm'; const html = htm.bind(React.createElement); + const FitText = Text; // TODO: NEED PUBLISH + const formidableLogo = 'https://avatars2.githubusercontent.com/u/5078602?s=280&v=4'; diff --git a/examples/one-page/scripts/one-page.js b/examples/one-page/scripts/one-page.js index 3b1f1e5e..8ea872d1 100644 --- a/examples/one-page/scripts/one-page.js +++ b/examples/one-page/scripts/one-page.js @@ -16,7 +16,7 @@ const SRC_FILE = path.join(EXAMPLES, 'js/index.js'); const DEST_FILE = path.join(EXAMPLES, 'one-page/index.html'); // Dependencies. -const ESM_SH_VERSION = 'v121'; // v121, stable, etc. +const ESM_SH_VERSION = ''; // 'v121/, stable, etc. const { dependencies, peerDependencies @@ -25,10 +25,10 @@ const reactPkgPath = require.resolve('react/package.json', { paths: [SPECTACLE_PATH] }); const { version: reactVersion } = require(reactPkgPath); -const DEPS = `deps=react@${reactVersion}`; +const EXTERNAL = `external=react,react-dom`; // Toggle dev resources. (Use if debugging load / dependency errors). -const IS_DEV = false; +const IS_DEV = true; const DEV = IS_DEV ? '&dev' : ''; // Use local built spectacle? Toggle to `true` for dev-only. @@ -39,13 +39,15 @@ const USE_LOCAL = false; // ================================================================================================ // Import Map // ================================================================================================ -const importUrl = (k, v, extra = '') => { +const importUrl = (k, v, extra = '', params = '') => { + let external = EXTERNAL; // Pin react and react-dom. if (k === 'react' || k === 'react-dom') { v = reactVersion; + external = ''; } - return `https://esm.sh/${ESM_SH_VERSION}/${k}@${v}${extra}?${DEPS}${DEV}`; + return `https://esm.sh/${ESM_SH_VERSION}${k}@${v}${extra}?${external}${params}${DEV}`; }; const getImportMap = () => { @@ -54,7 +56,7 @@ const getImportMap = () => { htm: importUrl('htm', '^3'), spectacle: USE_LOCAL ? '../../packages/spectacle/lib/index.mjs' - : 'https://esm.sh/spectacle@10?bundle' + : importUrl('spectacle', '10', '', '&bundle') }; Object.entries(Object.assign({}, dependencies, peerDependencies))