From 386c4cc5541f6c8049f870ccb1c11df617d63c0f Mon Sep 17 00:00:00 2001 From: Cole Willsea Date: Wed, 24 Jun 2020 10:12:37 -0700 Subject: [PATCH 1/2] fix cdr-tokens import in sandbox --- utils/buildSandbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/buildSandbox.js b/utils/buildSandbox.js index f3e9097ae..58eb8ead8 100644 --- a/utils/buildSandbox.js +++ b/utils/buildSandbox.js @@ -32,7 +32,7 @@ export default function makeMeASandbox(data, model) { // TODO: can we grab the preceding text to use for description? "description": "https://rei.github.io/rei-cedar-docs/", "dependencies": { - "@rei/cdr-tokens": packageJson.devDependencies['@rei/cdr-tokens'], + "@rei/cdr-tokens": packageJson.dependencies['@rei/cdr-tokens'], "@rei/cedar": packageJson.dependencies['@rei/cedar'], "vue": "^2.5.22" } From 095cabf2dd7e5dda8c0886e191f88a734fd81f52 Mon Sep 17 00:00:00 2001 From: Cole Willsea Date: Wed, 24 Jun 2020 10:49:14 -0700 Subject: [PATCH 2/2] point sandbox imports at cedar.mjs rather than ESM lib bundle --- utils/buildSandbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/buildSandbox.js b/utils/buildSandbox.js index 58eb8ead8..2920b8e62 100644 --- a/utils/buildSandbox.js +++ b/utils/buildSandbox.js @@ -89,7 +89,7 @@ function buildContent(data, model, fontImport) { } function buildScriptTag(data, model) { - const componentsImport = `import { ${data.components} } from "@rei/cedar";`; + const componentsImport = `import { ${data.components} } from "@rei/cedar/dist/cedar.mjs"; // NOTE: importing from '@rei/cedar/dist/cedar.mjs' to bypass a codesandbox bug. Please import from '@rei/cedar' in your code.`; return ` ${data.components ? componentsImport : ''}