From a481ffef17347a859481e18805a83f8ff24149bb Mon Sep 17 00:00:00 2001 From: Alf Eaton <75253002+aeaton-overleaf@users.noreply.github.com> Date: Wed, 3 Mar 2021 12:52:29 +0000 Subject: [PATCH] Merge pull request #3645 from overleaf/ae-import-config Add config for optional modules GitOrigin-RevId: 082261eff5d505ce98dfaafe179547b312c0511b --- services/web/.gitignore | 2 ++ services/web/.storybook/main.js | 13 ++++++++++++- services/web/config/settings.defaults.coffee | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/services/web/.gitignore b/services/web/.gitignore index 718e6b6217..d36fdbc34b 100644 --- a/services/web/.gitignore +++ b/services/web/.gitignore @@ -58,6 +58,8 @@ Gemfile.lock docker-shared.yml config/*.coffee +!config/settings.defaults.coffee +!config/settings.webpack.coffee modules/**/Makefile diff --git a/services/web/.storybook/main.js b/services/web/.storybook/main.js index d406d3bfca..8b1994a907 100644 --- a/services/web/.storybook/main.js +++ b/services/web/.storybook/main.js @@ -1,7 +1,18 @@ +const path = require('path') + +// NOTE: must be set before webpack config is imported +process.env.SHARELATEX_CONFIG = path.resolve( + __dirname, + '../config/settings.webpack.coffee' +) + const customConfig = require('../webpack.config.dev') module.exports = { - stories: ['../frontend/stories/**/*.stories.js'], + stories: [ + '../frontend/stories/**/*.stories.js', + '../modules/**/stories/**/*.stories.js' + ], addons: ['@storybook/addon-essentials', '@storybook/addon-a11y'], webpackFinal: storybookConfig => { // Combine Storybook's webpack loaders with our webpack loaders diff --git a/services/web/config/settings.defaults.coffee b/services/web/config/settings.defaults.coffee index b5767b462b..e56cecaaec 100644 --- a/services/web/config/settings.defaults.coffee +++ b/services/web/config/settings.defaults.coffee @@ -680,3 +680,8 @@ module.exports = settings = 'th': [ 'abbr', 'headers', 'colspan', 'rowspan', 'scope', 'sorted', 'style' ] 'tr': [ 'class' ] 'video': [ 'alt', 'class', 'controls', 'height', 'width' ] + + overleafModuleImports: { + # modules to import (an empty array for each set of modules) + } +