Skip to content
Snippets Groups Projects
Commit 52e7af41 authored by Calen Pennington's avatar Calen Pennington Committed by Ari Rizzitano
Browse files

Move pattern-replacement file lists into a separate file

Move pattern-replacement file lists into a separate file

punt the react stuff for now
parent c8e1e144
Branches
Tags release-2020-06-18-12.21
No related merge requests found
/* global gettext */
import PropTypes from 'prop-types';
import React from 'react';
export class NoTextbooks extends React.Component {
render() {
return (
<div className="no-textbook-content">
<p>
{gettext("You haven't added any textbooks to this course yet.")}
<a href="#" className="button new-button">
<span className="icon fa fa-plus" aria-hidden="true"></span>
{gettext("Add your first textbook")}
</a>
</p>
</div>
);
}
}
NoTextbooks.propTypes = {
};
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/paging_footer.js'),
path.resolve(__dirname, '../cms/static/js/views/paging.js'),
path.resolve(__dirname, '../common/static/common/js/components/utils/view_utils.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')
]
}
......@@ -7,108 +7,7 @@ var webpack = require('webpack');
var BundleTracker = require('webpack-bundle-tracker');
var StringReplace = require('string-replace-webpack-plugin');
var namespacedRequireFiles = [
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/utils/view_utils.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.
var filesWithTextBangUnderscore = [
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')
];
var files = require('./webpack-config/file-lists.js');
var defineHeader = /\(function ?\(define(, require)?\) ?\{/;
var defineFooter = /\}\)\.call\(this, define \|\| RequireJS\.define(, require \|\| RequireJS\.require)?\);/;
......@@ -122,7 +21,6 @@ module.exports = {
CourseOrLibraryListing: './cms/static/js/features_jsx/studio/CourseOrLibraryListing.jsx',
'js/pages/login': './cms/static/js/pages/login.js',
'js/pages/textbooks': './cms/static/js/pages/textbooks.js',
NoTextbooks: './cms/static/js/features_jsx/studio/NoTextbooks.jsx',
// LMS
SingleSupportForm: './lms/static/support/jsx/single_support_form.jsx',
......@@ -203,7 +101,7 @@ module.exports = {
],
rules: [
{
test: namespacedRequireFiles,
test: files.namespacedRequire,
loader: StringReplace.replace(
['babel-loader'],
{
......@@ -220,11 +118,26 @@ module.exports = {
}
)
},
{
test: files.textBangUnderscore,
loader: StringReplace.replace(
['babel-loader'],
{
replacements: [
{
pattern: /text!(.*\.underscore)/,
replacement: function(match, p1) { return p1; }
}
]
}
)
},
{
test: /\.(js|jsx)$/,
exclude: [
/node_modules/,
namespacedRequireFiles
files.namespacedRequire,
files.textBangUnderscore
],
use: 'babel-loader'
},
......@@ -269,7 +182,6 @@ module.exports = {
'edx-ui-toolkit': 'edx-ui-toolkit/src/', // @TODO: some paths in toolkit are not valid relative paths
'jquery.ui': 'jQuery-File-Upload/js/vendor/jquery.ui.widget.js',
jquery: 'jquery/src/jquery', // Use the non-dist form of jQuery for better debugging + optimization
// 'backbone': 'backbone',
'backbone.associations': 'backbone-associations-min',
// See sinon/webpack interaction weirdness:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment