diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-29 00:08:52 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-29 00:08:52 +0000 |
commit | 21b8ed2e35ee50538ddb2e48ad2b04de2eba43d6 (patch) | |
tree | d6e65cb4660e9aa2d79fbcee590c68b317ba204d /storybook/config | |
parent | 71d6b9014bef64436bbd996667e6458ebde561c4 (diff) | |
download | gitlab-ce-21b8ed2e35ee50538ddb2e48ad2b04de2eba43d6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'storybook/config')
-rw-r--r-- | storybook/config/webpack.config.js | 22 |
1 files changed, 22 insertions, 0 deletions
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 |