Skip to content

Commit

Permalink
Merge pull request #12848 from rtibbles/public_path
Browse files Browse the repository at this point in the history
Use webpack's built in dynamic public path setting
  • Loading branch information
rtibbles authored Nov 21, 2024
2 parents 849b382 + a82d6dc commit d0acf93
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
12 changes: 0 additions & 12 deletions kolibri/core/assets/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ import coreModule from './state/modules/core';
// Do this before any async imports to ensure that public paths
// are set correctly
urls.setUp();
if (process.env.NODE_ENV === 'production') {
/* eslint-disable no-undef */
__webpack_public_path__ = urls.static(`${__kolibriModuleName}/`);
/* eslint-enable */
}

// Shim window.location.origin for IE.
if (!window.location.origin) {
window.location.origin = `${window.location.protocol}//${window.location.hostname}${
window.location.port ? `:${window.location.port}` : ''
}`;
}

// set up logging
logging.setDefaultLevel(process.env.NODE_ENV === 'production' ? 2 : 0);
Expand Down
7 changes: 0 additions & 7 deletions packages/kolibri-module/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
*/

import coreApp from 'kolibri';
import urls from 'kolibri/urls';

if (process.env.NODE_ENV === 'production') {
/* eslint-disable no-undef */
__webpack_public_path__ = urls.static(`${__kolibriModuleName}/`);
/* eslint-enable */
}

export default class KolibriModule {
/**
Expand Down
3 changes: 2 additions & 1 deletion packages/kolibri-tools/lib/webpack.config.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ module.exports = (
// webpack properly handles that or not.
chunkLoadingGlobal: 'webpackChunkwebpack__' + data.name.replace('.', ''),
scriptType: 'text/javascript',
pathinfo: mode === 'production',
pathinfo: false,
publicPath: 'auto',
},
resolve: {
alias,
Expand Down

0 comments on commit d0acf93

Please sign in to comment.