diff --git a/consoles/my-joy-images/lib/index.js b/consoles/my-joy-images/lib/index.js index 643b2c00..75c7af75 100644 --- a/consoles/my-joy-images/lib/index.js +++ b/consoles/my-joy-images/lib/index.js @@ -84,24 +84,24 @@ exports.register = async server => { }); } + const buildPathname = Path.join(buildStatic, 'static', rest); + const [err2] = await Intercept( + Fs.access(buildPathname, Fs.constants.R_OK) + ); + + if (!err2) { + return h.file(buildPathname, { + confine: buildStatic + }); + } + const filename = manifest[rest]; if (!filename) { return Boom.notFound(); } const buildMapPathname = Path.join(buildRoot, filename); - const [err2] = await Intercept( - Fs.access(buildMapPathname, Fs.constants.R_OK) - ); - - if (!err2) { - return h.file(buildMapPathname, { - confine: buildStatic - }); - } - - const buildPathname = Path.join(buildStatic, rest); - return h.file(buildPathname, { + return h.file(buildMapPathname, { confine: buildStatic }); } diff --git a/consoles/my-joy-instances/lib/index.js b/consoles/my-joy-instances/lib/index.js index 6764a95a..66f99716 100644 --- a/consoles/my-joy-instances/lib/index.js +++ b/consoles/my-joy-instances/lib/index.js @@ -84,24 +84,24 @@ exports.register = async server => { }); } + const buildPathname = Path.join(buildStatic, 'static', rest); + const [err2] = await Intercept( + Fs.access(buildPathname, Fs.constants.R_OK) + ); + + if (!err2) { + return h.file(buildPathname, { + confine: buildStatic + }); + } + const filename = manifest[rest]; if (!filename) { return Boom.notFound(); } const buildMapPathname = Path.join(buildRoot, filename); - const [err2] = await Intercept( - Fs.access(buildMapPathname, Fs.constants.R_OK) - ); - - if (!err2) { - return h.file(buildMapPathname, { - confine: buildStatic - }); - } - - const buildPathname = Path.join(buildStatic, rest); - return h.file(buildPathname, { + return h.file(buildMapPathname, { confine: buildStatic }); } diff --git a/consoles/my-joy-navigation/lib/index.js b/consoles/my-joy-navigation/lib/index.js index bee77337..6b1a07f4 100644 --- a/consoles/my-joy-navigation/lib/index.js +++ b/consoles/my-joy-navigation/lib/index.js @@ -79,24 +79,24 @@ exports.register = async server => { }); } + const buildPathname = Path.join(buildStatic, 'static', rest); + const [err2] = await Intercept( + Fs.access(buildPathname, Fs.constants.R_OK) + ); + + if (!err2) { + return h.file(buildPathname, { + confine: buildStatic + }); + } + const filename = manifest[rest]; if (!filename) { return Boom.notFound(); } const buildMapPathname = Path.join(buildRoot, filename); - const [err2] = await Intercept( - Fs.access(buildMapPathname, Fs.constants.R_OK) - ); - - if (!err2) { - return h.file(buildMapPathname, { - confine: buildStatic - }); - } - - const buildPathname = Path.join(buildStatic, rest); - return h.file(buildPathname, { + return h.file(buildMapPathname, { confine: buildStatic }); } diff --git a/packages/ui-toolkit/src/styleguide/wrapper.js b/packages/ui-toolkit/src/styleguide/wrapper.js index c0125b57..e61e97d7 100644 --- a/packages/ui-toolkit/src/styleguide/wrapper.js +++ b/packages/ui-toolkit/src/styleguide/wrapper.js @@ -1,5 +1,5 @@ import React from 'react'; -import { ThemeProvider, injectGlobal } from 'styled-components'; +import styled, { ThemeProvider, injectGlobal } from 'styled-components'; import theme from '../theme'; import Base from '../base';