Просмотр исходного кода

Merge pull request #4243 from overleaf/as-fix-webpack-public-path

Configure webpack public path for gallery search bundle, fixing translations failing to load

GitOrigin-RevId: e785ccac2bbba7ff9d929730c6ea84249f6db109
Alf Eaton 5 лет назад
Родитель
Сommit
94641f737c

+ 1 - 0
services/web/frontend/js/base.js

@@ -16,6 +16,7 @@
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  */
 
+import './utils/webpack-public-path'
 import './libraries'
 import './infrastructure/error-reporter'
 import './modules/recursionHelper'

+ 0 - 5
services/web/frontend/js/libraries.js

@@ -18,8 +18,3 @@ import 'isomorphic-unfetch'
 
 // Rewrite meta elements
 import './utils/meta'
-
-// Configure dynamically loaded assets (via webpack) to be downloaded from CDN
-// See: https://webpack.js.org/guides/public-path/#on-the-fly
-// eslint-disable-next-line no-undef, camelcase
-__webpack_public_path__ = window.baseAssetPath

+ 6 - 0
services/web/frontend/js/utils/webpack-public-path.js

@@ -0,0 +1,6 @@
+import getMeta from './meta'
+
+// Configure dynamically loaded assets (via webpack) to be downloaded from CDN
+// See: https://webpack.js.org/guides/public-path/#on-the-fly
+// eslint-disable-next-line no-undef, camelcase
+__webpack_public_path__ = getMeta('ol-baseAssetPath')