diff --git a/services/web/frontend/js/base.js b/services/web/frontend/js/base.js index 60f0b38da3..1059b69a55 100644 --- a/services/web/frontend/js/base.js +++ b/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' diff --git a/services/web/frontend/js/libraries.js b/services/web/frontend/js/libraries.js index 87ac1df89c..b33fa17904 100644 --- a/services/web/frontend/js/libraries.js +++ b/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 diff --git a/services/web/frontend/js/utils/webpack-public-path.js b/services/web/frontend/js/utils/webpack-public-path.js new file mode 100644 index 0000000000..4675dfd3f8 --- /dev/null +++ b/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')