From 20920b58e692ab5b13919158161413a639c4cdd3 Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Wed, 26 Feb 2020 20:12:39 +1100 Subject: [PATCH] Fix `configFilename` containing backticks In windows the path sep is '\' which will lead to weird stuff like: https://github.com/chromaui/learnstorybook.com/issues/284 --- lib/core/src/server/preview/iframe-webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/src/server/preview/iframe-webpack.config.js b/lib/core/src/server/preview/iframe-webpack.config.js index c91336d5345..c5cfe62766c 100644 --- a/lib/core/src/server/preview/iframe-webpack.config.js +++ b/lib/core/src/server/preview/iframe-webpack.config.js @@ -55,7 +55,7 @@ export default ({ virtualModuleMapping[entryFilename] = ` import { addDecorator, addParameters } from '@storybook/client-api'; - const { decorators, parameters } = require('${configFilename}'); + const { decorators, parameters } = require(${JSON.stringify(configFilename)}); if (decorators) decorators.forEach(decorator => addDecorator(decorator)); if (parameters) addParameters(parameters);