kopia lustrzana https://github.com/wagtail/wagtail
Move entrypoints into an admin subfolder
This allows us to have entrypoints compiling to other apps besides wagtailadmin.pull/6680/head
rodzic
d18ffb0233
commit
a2ff3e1252
|
@ -4,7 +4,7 @@ import draftail, {
|
|||
Document,
|
||||
ImageBlock,
|
||||
EmbedBlock,
|
||||
} from '../components/Draftail/index';
|
||||
} from '../../components/Draftail/index';
|
||||
|
||||
/**
|
||||
* Entry point loaded when the Draftail editor is in use.
|
|
@ -1,6 +1,6 @@
|
|||
window.$ = require('../../../wagtail/admin/static_src/wagtailadmin/js/vendor/jquery-3.5.1.min');
|
||||
window.$ = require('../../../../wagtail/admin/static_src/wagtailadmin/js/vendor/jquery-3.5.1.min');
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
require('../../../wagtail/admin/static_src/wagtailadmin/js/vendor/urlify').default;
|
||||
require('../../../../wagtail/admin/static_src/wagtailadmin/js/vendor/urlify').default;
|
||||
|
||||
const cleanForSlug = require('./page-editor').cleanForSlug;
|
||||
|
|
@ -9,7 +9,7 @@ import {
|
|||
initSkipLink,
|
||||
initIE11Warning,
|
||||
initUpgradeNotification,
|
||||
} from '..';
|
||||
} from '../..';
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// Run react-axe in development only, so it does not affect performance
|
|
@ -1,6 +1,6 @@
|
|||
jest.mock('..');
|
||||
jest.mock('../..');
|
||||
|
||||
const wagtail = require('..');
|
||||
const wagtail = require('../..');
|
||||
|
||||
document.addEventListener = jest.fn();
|
||||
|
|
@ -13,41 +13,45 @@ const exposedDependencies = {
|
|||
};
|
||||
|
||||
module.exports = function exports() {
|
||||
const entrypoints = [
|
||||
'blocks/list',
|
||||
'blocks/sequence',
|
||||
'blocks/stream',
|
||||
'blocks/struct',
|
||||
'core',
|
||||
'date-time-chooser',
|
||||
'draftail',
|
||||
'expanding_formset',
|
||||
'filtered-select',
|
||||
'hallo-bootstrap',
|
||||
'hallo-plugins/hallo-hr',
|
||||
'hallo-plugins/hallo-requireparagraphs',
|
||||
'hallo-plugins/hallo-wagtaillink',
|
||||
'lock-unlock-action',
|
||||
'modal-workflow',
|
||||
'page-chooser-modal',
|
||||
'page-chooser',
|
||||
'page-editor',
|
||||
'privacy-switch',
|
||||
'task-chooser-modal',
|
||||
'task-chooser',
|
||||
'userbar',
|
||||
'wagtailadmin',
|
||||
'workflow-action',
|
||||
'workflow-status',
|
||||
];
|
||||
const entrypoints = {
|
||||
admin: [
|
||||
'blocks/list',
|
||||
'blocks/sequence',
|
||||
'blocks/stream',
|
||||
'blocks/struct',
|
||||
'core',
|
||||
'date-time-chooser',
|
||||
'draftail',
|
||||
'expanding_formset',
|
||||
'filtered-select',
|
||||
'hallo-bootstrap',
|
||||
'hallo-plugins/hallo-hr',
|
||||
'hallo-plugins/hallo-requireparagraphs',
|
||||
'hallo-plugins/hallo-wagtaillink',
|
||||
'lock-unlock-action',
|
||||
'modal-workflow',
|
||||
'page-chooser-modal',
|
||||
'page-chooser',
|
||||
'page-editor',
|
||||
'privacy-switch',
|
||||
'task-chooser-modal',
|
||||
'task-chooser',
|
||||
'userbar',
|
||||
'wagtailadmin',
|
||||
'workflow-action',
|
||||
'workflow-status',
|
||||
],
|
||||
};
|
||||
|
||||
const entry = {};
|
||||
entrypoints.forEach(moduleName => {
|
||||
entry[getOutputPath('admin', moduleName)] = [
|
||||
'./client/src/utils/polyfills.js',
|
||||
`./client/src/entrypoints/${moduleName}.js`,
|
||||
];
|
||||
});
|
||||
for (const [appName, moduleNames] of Object.entries(entrypoints)) {
|
||||
moduleNames.forEach(moduleName => {
|
||||
entry[getOutputPath(appName, moduleName)] = [
|
||||
'./client/src/utils/polyfills.js',
|
||||
`./client/src/entrypoints/${appName}/${moduleName}.js`,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
entry: entry,
|
||||
|
|
Ładowanie…
Reference in New Issue