From 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 17 Nov 2022 11:33:21 +0000 Subject: Add latest changes from gitlab-org/gitlab@15-6-stable-ee --- storybook/config/webpack.config.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'storybook') diff --git a/storybook/config/webpack.config.js b/storybook/config/webpack.config.js index 51aaa1e18a6..a10ae0887ff 100644 --- a/storybook/config/webpack.config.js +++ b/storybook/config/webpack.config.js @@ -9,6 +9,12 @@ const IS_EE = require('../../config/helpers/is_ee_env'); const IS_JH = require('../../config/helpers/is_jh_env'); const gitlabWebpackConfig = require('../../config/webpack.config'); +const ROOT_PATH = path.resolve(__dirname, '..', '..'); +const EMPTY_VUE_COMPONENT_PATH = path.join( + ROOT_PATH, + 'app/assets/javascripts/vue_shared/components/empty_component.js', +); + const buildIncludePaths = (nodeSassIncludePaths, previouslyResolvedPath) => { const includePaths = []; if (path.isAbsolute(previouslyResolvedPath)) { @@ -144,6 +150,22 @@ module.exports = function storybookWebpackConfig({ config }) { // Silence webpack warnings about moment/pikaday not being able to resolve. config.plugins.push(new webpack.IgnorePlugin(/moment/, /pikaday/)); + if (!IS_EE) { + config.plugins.push( + new webpack.NormalModuleReplacementPlugin(/^ee_component\/(.*)\.vue/, (resource) => { + resource.request = EMPTY_VUE_COMPONENT_PATH; + }), + ); + } + + if (!IS_JH) { + config.plugins.push( + new webpack.NormalModuleReplacementPlugin(/^jh_component\/(.*)\.vue/, (resource) => { + resource.request = EMPTY_VUE_COMPONENT_PATH; + }), + ); + } + const baseIntegrationTestHelpersPath = 'spec/frontend_integration/test_helpers'; // Add any missing aliases from the main GitLab webpack config -- cgit v1.2.3