mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-18 18:18:23 -05:00
* Remove jest-junit and unignore build folder in web app packages We don't actually use the file output by jest-junit, and I don't think we have since we moved off of Jenkins for CI * Move parcel-namer-shared into build folder * MM-67323 Add loadSharedDependency API and script for plugins to use it * Fix client and mattermost-redux packages missing const enums * Change interface for webAppExternals
31 lines
994 B
JavaScript
31 lines
994 B
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
// This script is intended to be used by Mattermost plugins to set up their Webpack externals to share their
|
|
// dependencies with the web app. It includes both third party dependencies (React, etc) and the MM Shared package.
|
|
|
|
const windowExternals = {
|
|
react: 'React',
|
|
'react-dom': 'ReactDOM',
|
|
redux: 'Redux',
|
|
luxon: 'Luxon',
|
|
'react-redux': 'ReactRedux',
|
|
'prop-types': 'PropTypes',
|
|
'react-bootstrap': 'ReactBootstrap',
|
|
'react-router-dom': 'ReactRouterDom',
|
|
'react-intl': 'ReactIntl',
|
|
};
|
|
|
|
function webAppExternals() {
|
|
return [
|
|
windowExternals,
|
|
({request}, callback) => {
|
|
if ((/^@mattermost\/shared\//).test(request)) {
|
|
return callback(null, `promise globalThis.loadSharedDependency('${request}')`);
|
|
}
|
|
|
|
return callback();
|
|
},
|
|
];
|
|
}
|
|
module.exports = webAppExternals;
|