From 603c1bfac7eafd9ba8c6063f9ddef6daba993cfe Mon Sep 17 00:00:00 2001 From: hypnos Date: Thu, 28 Sep 2017 03:20:55 +0300 Subject: [PATCH] Fix polyfills loading order --- app/react/src/server/config.js | 5 +++-- app/vue/src/server/config.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/react/src/server/config.js b/app/react/src/server/config.js index 21d476051f4a..70f0f3a1ca72 100644 --- a/app/react/src/server/config.js +++ b/app/react/src/server/config.js @@ -33,13 +33,14 @@ export default function(configType, baseConfig, configDir) { // Check whether addons.js file exists inside the storybook. // Load the default addons.js file if it's missing. + // Insert it after polyfills.js, but before client/manager. const storybookDefaultAddonsPath = path.resolve(__dirname, 'addons.js'); const storybookCustomAddonsPath = path.resolve(configDir, 'addons.js'); if (fs.existsSync(storybookCustomAddonsPath)) { logger.info('=> Loading custom addons config.'); - config.entry.manager.unshift(storybookCustomAddonsPath); + config.entry.manager.splice(1, 0, storybookCustomAddonsPath); } else { - config.entry.manager.unshift(storybookDefaultAddonsPath); + config.entry.manager.splice(1, 0, storybookDefaultAddonsPath); } // Check whether user has a custom webpack config file and diff --git a/app/vue/src/server/config.js b/app/vue/src/server/config.js index 07425bd19cba..9b8c07558911 100644 --- a/app/vue/src/server/config.js +++ b/app/vue/src/server/config.js @@ -33,13 +33,14 @@ export default function(configType, baseConfig, configDir) { // Check whether addons.js file exists inside the storybook. // Load the default addons.js file if it's missing. + // Insert it after polyfills.js, but before client/manager. const storybookDefaultAddonsPath = path.resolve(__dirname, 'addons.js'); const storybookCustomAddonsPath = path.resolve(configDir, 'addons.js'); if (fs.existsSync(storybookCustomAddonsPath)) { logger.info('=> Loading custom addons config.'); - config.entry.manager.unshift(storybookCustomAddonsPath); + config.entry.manager.splice(1, 0, storybookCustomAddonsPath); } else { - config.entry.manager.unshift(storybookDefaultAddonsPath); + config.entry.manager.splice(1, 0, storybookDefaultAddonsPath); } // Check whether user has a custom webpack config file and