Files
edx-platform/webpack-config/file-lists.js
Kyle McCormick 9d4163d31f build: include built-in XBlock JS directly rather than copying it (#32480)
As part of the static asset build, JS modules for most built-in XBlocks were
unnecessarily copied from the original locations (under xmodule/js and
common/static/js) to a git-ignored location (under common/static/xmodule), and
then included into the Webpack builld via
common/static/xmodule/webpack.xmodule.config.js.

With this commit, we stop copying the JS modules. Instead, we have
common/static/xmodule/webpack.xmodule.config.js just reference the original
source under xmodule/js and common/static/js.

This lets us us radically simplify the xmodule/static_content.py build script.
It also sets the stage for the next change, in which we will check
webpack.xmodule.config.js into the repository, and delete
xmodule/static_content.py entirely.

common/static/xmodule/webpack.xmodule.config.js before:

    module.exports = {
        "entry": {
            "AboutBlockDisplay": [
                "./common/static/xmodule/modules/js/000-b82f6c436159f6bc7ca2513e29e82503.js",
                "./common/static/xmodule/modules/js/001-3ed86006526f75d6c844739193a84c11.js",
                "./common/static/xmodule/modules/js/002-3918b2d4f383c04fed8227cc9f523d6e.js",
                "./common/static/xmodule/modules/js/003-b3206f2283964743c4772b9d72c67d64.js",
                "./common/static/xmodule/modules/js/004-274b8109ca3426c2a6fde9ec2c56e969.js",
                "./common/static/xmodule/modules/js/005-26caba6f71877f63a7dd4f6796109bf6.js"
            ],
            "AboutBlockEditor": [
                "./common/static/xmodule/descriptors/js/000-b82f6c436159f6bc7ca2513e29e82503.js",
                "./common/static/xmodule/descriptors/js/001-19c4723cecaa5a5a46b8566b3544e732.js"
            ],
            // etc
        }
    };

common/static/xmodule/webpack.xmodule.config.js after:

    module.exports = {
        "entry": {
            "AboutBlockDisplay": [
                "./xmodule/js/src/xmodule.js",
                "./xmodule/js/src/html/display.js",
                "./xmodule/js/src/javascript_loader.js",
                "./xmodule/js/src/collapsible.js",
                "./xmodule/js/src/html/imageModal.js",
                "./xmodule/js/common_static/js/vendor/draggabilly.js"
            ],
            "AboutBlockEditor": [
                "./xmodule/js/src/xmodule.js",
                "./xmodule/js/src/html/edit.js"
            ],
            // etc
        }
    };

Part of: https://github.com/openedx/edx-platform/issues/32481
2023-07-26 13:27:38 -04:00

115 lines
9.3 KiB
JavaScript

/* eslint-disable max-len */
var path = require('path');
module.exports = {
namespacedRequire: [
path.resolve(__dirname, '../common/static/common/js/components/views/feedback_notification.js'),
path.resolve(__dirname, '../common/static/common/js/components/views/feedback_prompt.js'),
path.resolve(__dirname, '../common/static/common/js/components/views/feedback.js'),
path.resolve(__dirname, '../common/static/common/js/components/views/feedback_alert.js'),
path.resolve(__dirname, '../common/static/common/js/components/views/paging_footer.js'),
path.resolve(__dirname, '../cms/static/js/views/paging.js'),
path.resolve(__dirname, '../common/static/common/js/components/utils/view_utils.js'),
/xmodule\/js\/src/,
path.resolve(__dirname, '../openedx/features/course_bookmarks/static/course_bookmarks/js/views/bookmark_button.js')
],
// These files are used by RequireJS as well, so we can't remove
// the instances of "text!some/file.underscore" (which webpack currently
// processes twice). So instead we have webpack dynamically remove the `text!` prefix
// until we can remove RequireJS from the system.
textBangUnderscore: [
path.resolve(__dirname, '../cms/static/js/certificates/views/certificate_details.js'),
path.resolve(__dirname, '../cms/static/js/certificates/views/certificate_editor.js'),
path.resolve(__dirname, '../cms/static/js/certificates/views/certificate_preview.js'),
path.resolve(__dirname, '../cms/static/js/certificates/views/signatory_details.js'),
path.resolve(__dirname, '../cms/static/js/certificates/views/signatory_editor.js'),
path.resolve(__dirname, '../cms/static/js/views/active_video_upload_list.js'),
path.resolve(__dirname, '../cms/static/js/views/assets.js'),
path.resolve(__dirname, '../cms/static/js/views/course_video_settings.js'),
path.resolve(__dirname, '../cms/static/js/views/edit_chapter.js'),
path.resolve(__dirname, '../cms/static/js/views/experiment_group_edit.js'),
path.resolve(__dirname, '../cms/static/js/views/license.js'),
path.resolve(__dirname, '../cms/static/js/views/modals/move_xblock_modal.js'),
path.resolve(__dirname, '../cms/static/js/views/move_xblock_breadcrumb.js'),
path.resolve(__dirname, '../cms/static/js/views/move_xblock_list.js'),
path.resolve(__dirname, '../cms/static/js/views/paging_header.js'),
path.resolve(__dirname, '../cms/static/js/views/previous_video_upload_list.js'),
path.resolve(__dirname, '../cms/static/js/views/previous_video_upload.js'),
path.resolve(__dirname, '../cms/static/js/views/video_thumbnail.js'),
path.resolve(__dirname, '../cms/static/js/views/video_transcripts.js'),
path.resolve(__dirname, '../common/static/common/js/components/views/feedback.js'),
path.resolve(__dirname, '../common/static/common/js/components/views/paginated_view.js'),
path.resolve(__dirname, '../common/static/common/js/components/views/paging_footer.js'),
path.resolve(__dirname, '../common/static/common/js/components/views/paging_header.js'),
path.resolve(__dirname, '../common/static/common/js/components/views/progress_circle_view.js'),
path.resolve(__dirname, '../common/static/common/js/components/views/search_field.js'),
path.resolve(__dirname, '../common/static/common/js/components/views/tabbed_view.js'),
path.resolve(__dirname, '../lms/djangoapps/discussion/static/discussion/js/views/discussion_board_view.js'),
path.resolve(__dirname, '../lms/djangoapps/discussion/static/discussion/js/views/discussion_fake_breadcrumbs.js'),
path.resolve(__dirname, '../lms/djangoapps/discussion/static/discussion/js/views/discussion_search_view.js'),
path.resolve(__dirname, '../lms/djangoapps/discussion/static/discussion/js/views/discussion_user_profile_view.js'),
path.resolve(__dirname, '../lms/djangoapps/support/static/support/js/views/certificates.js'),
path.resolve(__dirname, '../lms/djangoapps/support/static/support/js/views/enrollment_modal.js'),
path.resolve(__dirname, '../lms/djangoapps/support/static/support/js/views/enrollment.js'),
path.resolve(__dirname, '../lms/djangoapps/support/static/support/js/views/manage_user.js'),
path.resolve(__dirname, '../lms/djangoapps/teams/static/teams/js/views/edit_team_members.js'),
path.resolve(__dirname, '../lms/djangoapps/teams/static/teams/js/views/edit_team.js'),
path.resolve(__dirname, '../lms/djangoapps/teams/static/teams/js/views/instructor_tools.js'),
path.resolve(__dirname, '../lms/djangoapps/teams/static/teams/js/views/team_card.js'),
path.resolve(__dirname, '../lms/djangoapps/teams/static/teams/js/views/team_profile_header_actions.js'),
path.resolve(__dirname, '../lms/djangoapps/teams/static/teams/js/views/team_profile.js'),
path.resolve(__dirname, '../lms/djangoapps/teams/static/teams/js/views/teams_tab.js'),
path.resolve(__dirname, '../lms/djangoapps/teams/static/teams/js/views/topic_teams.js'),
path.resolve(__dirname, '../lms/static/js/api_admin/views/catalog_preview.js'),
path.resolve(__dirname, '../lms/static/js/components/card/views/card.js'),
path.resolve(__dirname, '../lms/static/js/components/header/views/header.js'),
path.resolve(__dirname, '../lms/static/js/financial-assistance/views/financial_assistance_form_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/certificate_list_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/certificate_status_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/collection_list_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/course_card_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/course_enroll_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/course_entitlement_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/expired_notification_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/explore_new_programs_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/program_card_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/program_details_sidebar_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/program_details_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/program_header_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/sidebar_view.js'),
path.resolve(__dirname, '../lms/static/js/learner_dashboard/views/upgrade_message_view.js'),
path.resolve(__dirname, '../lms/static/js/student_account/views/account_section_view.js'),
path.resolve(__dirname, '../lms/static/js/student_account/views/account_settings_fields.js'),
path.resolve(__dirname, '../lms/static/js/student_account/views/account_settings_view.js'),
path.resolve(__dirname, '../lms/static/js/student_account/views/FormView.js'),
path.resolve(__dirname, '../lms/static/js/student_account/views/LoginView.js'),
path.resolve(__dirname, '../lms/static/js/student_account/views/RegisterView.js'),
path.resolve(__dirname, '../lms/static/js/views/fields.js'),
path.resolve(__dirname, '../lms/static/js/views/image_field.js'),
path.resolve(__dirname, '../lms/static/js/views/message_banner.js'),
path.resolve(__dirname, '../openedx/features/course_bookmarks/static/course_bookmarks/js/views/bookmarks_list.js'),
path.resolve(__dirname, '../openedx/features/course_search/static/course_search/js/spec/course_search_spec.js'),
path.resolve(
__dirname,
'../openedx/features/course_search/static/course_search/js/views/course_search_results_view.js'
),
path.resolve(
__dirname,
'../openedx/features/course_search/static/course_search/js/views/dashboard_search_results_view.js'
),
path.resolve(__dirname, '../openedx/features/course_search/static/course_search/js/views/search_results_view.js'),
path.resolve(__dirname, '../openedx/features/learner_profile/static/learner_profile/js/views/badge_list_container.js'),
path.resolve(__dirname, '../openedx/features/learner_profile/static/learner_profile/js/views/badge_list_view.js'),
path.resolve(__dirname, '../openedx/features/learner_profile/static/learner_profile/js/views/badge_view.js'),
path.resolve(
__dirname,
'../openedx/features/learner_profile/static/learner_profile/js/views/learner_profile_fields.js'
),
path.resolve(__dirname, '../openedx/features/learner_profile/static/learner_profile/js/views/section_two_tab.js'),
path.resolve(__dirname, '../openedx/features/learner_profile/static/learner_profile/js/views/share_modal_view.js'),
path.resolve(__dirname, '../node_modules/edx-ui-toolkit/src/js/dropdown-menu/dropdown-menu-view.js'),
path.resolve(__dirname, '../node_modules/edx-ui-toolkit/src/js/breadcrumbs/breadcrumbs-view.js')
]
};