소스 검색

Merge pull request #3645 from overleaf/ae-import-config

Add config for optional modules

GitOrigin-RevId: 082261eff5d505ce98dfaafe179547b312c0511b
Alf Eaton 5 년 전
부모
커밋
a481ffef17
3개의 변경된 파일19개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 0
      services/web/.gitignore
  2. 12 1
      services/web/.storybook/main.js
  3. 5 0
      services/web/config/settings.defaults.coffee

+ 2 - 0
services/web/.gitignore

@@ -58,6 +58,8 @@ Gemfile.lock
 docker-shared.yml
 
 config/*.coffee
+!config/settings.defaults.coffee
+!config/settings.webpack.coffee
 
 modules/**/Makefile
 

+ 12 - 1
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

+ 5 - 0
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)
+	}
+