Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use webpack's built in dynamic public path setting #12848

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -117,7 +117,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