diff --git a/frontend_tests/node_tests/copy_and_paste.js b/frontend_tests/node_tests/copy_and_paste.js index 000728e0be..abd5e7a9b5 100644 --- a/frontend_tests/node_tests/copy_and_paste.js +++ b/frontend_tests/node_tests/copy_and_paste.js @@ -11,7 +11,7 @@ const { document } = window; global.document = document; global.$ = require('jquery')(window); -zrequire('toMarkdown', 'node_modules/to-markdown/dist/to-markdown.js'); +zrequire('toMarkdown', 'to-markdown/dist/to-markdown.js'); var copy_and_paste = zrequire('copy_and_paste'); // Super stripped down version of the code in the drag-mock library diff --git a/frontend_tests/node_tests/markdown.js b/frontend_tests/node_tests/markdown.js index 6f7cfac61b..7ae95b84a2 100644 --- a/frontend_tests/node_tests/markdown.js +++ b/frontend_tests/node_tests/markdown.js @@ -1,6 +1,6 @@ /*global Dict */ zrequire('hash_util'); -zrequire('katex', 'node_modules/katex/dist/katex.min.js'); +zrequire('katex', 'katex/dist/katex.min.js'); zrequire('marked', 'third/marked/lib/marked'); zrequire('util'); zrequire('fenced_code'); diff --git a/frontend_tests/node_tests/message_edit.js b/frontend_tests/node_tests/message_edit.js index 4e00f1f37b..33db83fdb2 100644 --- a/frontend_tests/node_tests/message_edit.js +++ b/frontend_tests/node_tests/message_edit.js @@ -3,7 +3,7 @@ set_global('page_params', {}); global.stub_out_jquery(); -zrequire('XDate', 'node_modules/xdate/src/xdate'); +zrequire('XDate', 'xdate/src/xdate'); zrequire('message_edit'); var get_editability = message_edit.get_editability; diff --git a/frontend_tests/node_tests/message_list_view.js b/frontend_tests/node_tests/message_list_view.js index bc9b491cf0..6992f7ca7c 100644 --- a/frontend_tests/node_tests/message_list_view.js +++ b/frontend_tests/node_tests/message_list_view.js @@ -2,7 +2,7 @@ set_global('$', global.make_zjquery()); set_global('document', 'document-stub'); zrequire('util'); -zrequire('XDate', 'node_modules/xdate/src/xdate'); +zrequire('XDate', 'xdate/src/xdate'); zrequire('Filter', 'js/filter'); zrequire('FetchStatus', 'js/fetch_status'); zrequire('MessageListData', 'js/message_list_data'); diff --git a/frontend_tests/node_tests/password.js b/frontend_tests/node_tests/password.js index 062c569225..82006ffb2c 100644 --- a/frontend_tests/node_tests/password.js +++ b/frontend_tests/node_tests/password.js @@ -1,4 +1,4 @@ -zrequire('zxcvbn', 'node_modules/zxcvbn/dist/zxcvbn'); +zrequire('zxcvbn', 'zxcvbn/dist/zxcvbn'); zrequire('common'); set_global('i18n', global.stub_i18n); diff --git a/frontend_tests/zjsunit/finder.js b/frontend_tests/zjsunit/finder.js index c8c0f418fe..93ca5eb24b 100644 --- a/frontend_tests/zjsunit/finder.js +++ b/frontend_tests/zjsunit/finder.js @@ -2,7 +2,7 @@ var finder = (function () { var exports = {}; -var _ = require('node_modules/underscore/underscore.js'); +var _ = require('underscore/underscore.js'); var fs = require('fs'); var path = require('path'); diff --git a/frontend_tests/zjsunit/index.js b/frontend_tests/zjsunit/index.js index fe8bd3c1c7..533c80adf2 100644 --- a/frontend_tests/zjsunit/index.js +++ b/frontend_tests/zjsunit/index.js @@ -12,9 +12,9 @@ var path = require('path'); var fs = require('fs'); global.assert = require('assert'); -require('node_modules/string.prototype.codepointat/codepointat.js'); +require('string.prototype.codepointat/codepointat.js'); -global._ = require('node_modules/underscore/underscore.js'); +global._ = require('underscore/underscore.js'); var _ = global._; const windowObj = { location: { diff --git a/frontend_tests/zjsunit/namespace.js b/frontend_tests/zjsunit/namespace.js index e5d0eed4a2..5ea59ac687 100644 --- a/frontend_tests/zjsunit/namespace.js +++ b/frontend_tests/zjsunit/namespace.js @@ -1,6 +1,6 @@ var namespace = (function () { -var _ = require('node_modules/underscore/underscore.js'); +var _ = require('underscore/underscore.js'); var exports = {}; var dependencies = []; diff --git a/frontend_tests/zjsunit/render.js b/frontend_tests/zjsunit/render.js index acfed6d383..4a37fb1d6e 100644 --- a/frontend_tests/zjsunit/render.js +++ b/frontend_tests/zjsunit/render.js @@ -3,7 +3,7 @@ var render = (function () { var exports = {}; var fs = require('fs'); -var _ = require('node_modules/underscore/underscore.js'); +var _ = require('underscore/underscore.js'); var Handlebars = require('handlebars'); function template_dir() { diff --git a/frontend_tests/zjsunit/stub.js b/frontend_tests/zjsunit/stub.js index e59ad6232b..80aced50f4 100644 --- a/frontend_tests/zjsunit/stub.js +++ b/frontend_tests/zjsunit/stub.js @@ -1,6 +1,6 @@ var stub = (function () { -var _ = require('node_modules/underscore/underscore.js'); +var _ = require('underscore/underscore.js'); var exports = {}; // Stubs don't do any magical modifications to your namespace. They diff --git a/static/js/bundles/app.js b/static/js/bundles/app.js index 41754fb4af..c0e0ba61a1 100644 --- a/static/js/bundles/app.js +++ b/static/js/bundles/app.js @@ -10,18 +10,18 @@ import "third/jquery-autosize/jquery.autosize.js"; import "third/spectrum/spectrum.js"; import "third/sockjs/sockjs-0.3.4.js"; import "third/marked/lib/marked.js"; -import "node_modules/xdate/src/xdate.js"; -import "node_modules/jquery-validation/dist/jquery.validate.js"; -import "node_modules/blueimp-md5/js/md5.js"; -import "node_modules/clipboard/dist/clipboard.js"; -import "node_modules/string.prototype.codepointat/codepointat.js"; -import "node_modules/winchan/winchan.js"; -import "node_modules/handlebars/dist/handlebars.runtime.js"; -import "node_modules/to-markdown/dist/to-markdown.js"; -import "node_modules/flatpickr/dist/flatpickr.js"; -import "node_modules/flatpickr/dist/plugins/confirmDate/confirmDate.js"; -import "node_modules/error-stack-parser/dist/error-stack-parser.min.js"; -import "node_modules/sortablejs/Sortable.js"; +import "xdate/src/xdate.js"; +import "jquery-validation/dist/jquery.validate.js"; +import "blueimp-md5/js/md5.js"; +import "clipboard/dist/clipboard.js"; +import "string.prototype.codepointat/codepointat.js"; +import "winchan/winchan.js"; +import "handlebars/dist/handlebars.runtime.js"; +import "to-markdown/dist/to-markdown.js"; +import "flatpickr/dist/flatpickr.js"; +import "flatpickr/dist/plugins/confirmDate/confirmDate.js"; +import "error-stack-parser/dist/error-stack-parser.min.js"; +import "sortablejs/Sortable.js"; import "generated/emoji/emoji_codes.js"; import "generated/pygments_data.js"; @@ -208,9 +208,9 @@ import 'js/stream_ui_updates.js'; import "third/bootstrap-notify/css/bootstrap-notify.css"; import "third/spectrum/spectrum.css"; -import "node_modules/katex/dist/katex.css"; -import "node_modules/flatpickr/dist/flatpickr.css"; -import "node_modules/flatpickr/dist/plugins/confirmDate/confirmDate.css"; +import "katex/dist/katex.css"; +import "flatpickr/dist/flatpickr.css"; +import "flatpickr/dist/plugins/confirmDate/confirmDate.css"; import "styles/components.scss"; import "styles/app_components.scss"; import "styles/zulip.scss"; diff --git a/static/js/bundles/commons.js b/static/js/bundles/commons.js index c8adc103f2..2cffe94f1e 100644 --- a/static/js/bundles/commons.js +++ b/static/js/bundles/commons.js @@ -1,20 +1,20 @@ import "string.prototype.endswith"; import "string.prototype.startswith"; import "string.prototype.codepointat"; -import "node_modules/jquery/dist/jquery.js"; -import "node_modules/underscore/underscore.js"; +import "jquery/dist/jquery.js"; +import "underscore/underscore.js"; import "js/blueslip.js"; import "third/bootstrap/js/bootstrap.js"; import "third/bootstrap-typeahead/typeahead.js"; import "js/common.js"; -import "node_modules/moment/min/moment.min.js"; -import "node_modules/moment-timezone/builds/moment-timezone-with-data.min.js"; -import "node_modules/sortablejs/Sortable.js"; +import "moment/min/moment.min.js"; +import "moment-timezone/builds/moment-timezone-with-data.min.js"; +import "sortablejs/Sortable.js"; import "third/bootstrap/css/bootstrap.css"; import "third/bootstrap/css/bootstrap-btn.css"; import "third/bootstrap/css/bootstrap-responsive.css"; -import "node_modules/simplebar/dist/simplebar.css"; -import "node_modules/font-awesome/css/font-awesome.css"; +import "simplebar/dist/simplebar.css"; +import "font-awesome/css/font-awesome.css"; import "generated/icons/style.css"; -import "node_modules/source-sans-pro/source-sans-pro.css"; +import "source-sans-pro/source-sans-pro.css"; import "styles/pygments.scss"; diff --git a/static/js/popovers.js b/static/js/popovers.js index 78be3f96a3..988767fe4f 100644 --- a/static/js/popovers.js +++ b/static/js/popovers.js @@ -1,4 +1,4 @@ -var confirmDatePlugin = require("node_modules/flatpickr/dist/plugins/confirmDate/confirmDate.js"); +var confirmDatePlugin = require("flatpickr/dist/plugins/confirmDate/confirmDate.js"); var popovers = (function () { diff --git a/static/third/katex/cli.js b/static/third/katex/cli.js index f112603b43..3b1a9eaace 100644 --- a/static/third/katex/cli.js +++ b/static/third/katex/cli.js @@ -39,7 +39,7 @@ try { katex = require("/home/zulip/prod-static/min/katex.js"); } catch (ex) { // Import KaTeX from node_modules (development environment) otherwise - katex = require("../../node_modules/katex/dist/katex.js"); + katex = require("katex/dist/katex.js"); } let input = ""; diff --git a/tools/webpack.assets.json b/tools/webpack.assets.json index 031aca9afa..d112b2e949 100644 --- a/tools/webpack.assets.json +++ b/tools/webpack.assets.json @@ -1,12 +1,12 @@ { "activity": [ - "./node_modules/sorttable/sorttable.js", + "sorttable/sorttable.js", "./static/js/analytics/activity.js", "./static/styles/portico/activity.scss" ], "archive": [ - "./node_modules/xdate/src/xdate.js", - "./node_modules/handlebars/dist/handlebars.runtime.js", + "xdate/src/xdate.js", + "handlebars/dist/handlebars.runtime.js", "./static/js/archive.js", "./static/js/colorspace.js", "./static/js/floating_recipient_bar.js", @@ -19,7 +19,7 @@ "billing": [ "./static/js/billing/helpers.js", "./static/js/billing/billing.js", - "./node_modules/handlebars/dist/handlebars.runtime.js", + "handlebars/dist/handlebars.runtime.js", "./static/js/templates.js", "./static/templates/compiled.js", "./static/js/loading.js", @@ -28,7 +28,7 @@ "upgrade": [ "./static/js/billing/helpers.js", "./static/js/billing/upgrade.js", - "./node_modules/handlebars/dist/handlebars.runtime.js", + "handlebars/dist/handlebars.runtime.js", "./static/js/templates.js", "./static/templates/compiled.js", "./static/js/loading.js", @@ -45,31 +45,31 @@ "string.prototype.endswith", "string.prototype.startswith", "string.prototype.codepointat", - "./node_modules/jquery/dist/jquery.js", - "./node_modules/underscore/underscore.js", + "jquery/dist/jquery.js", + "underscore/underscore.js", "./static/js/csrf.js", "./static/js/blueslip.js", "./static/third/bootstrap/js/bootstrap.js", "./static/js/common.js", - "./node_modules/moment/min/moment.min.js", - "./node_modules/moment-timezone/builds/moment-timezone-with-data.min.js", - "./node_modules/sortablejs/Sortable.js", + "moment/min/moment.min.js", + "moment-timezone/builds/moment-timezone-with-data.min.js", + "sortablejs/Sortable.js", "./static/third/bootstrap/css/bootstrap.css", "./static/third/bootstrap/css/bootstrap-btn.css", "./static/third/bootstrap/css/bootstrap-responsive.css", - "./node_modules/simplebar/dist/simplebar.css", - "./node_modules/font-awesome/css/font-awesome.css", + "simplebar/dist/simplebar.css", + "font-awesome/css/font-awesome.css", "./static/generated/icons/style.css", - "./node_modules/source-sans-pro/source-sans-pro.css", + "source-sans-pro/source-sans-pro.css", "./static/styles/pygments.scss" ], "help": [ - "./node_modules/simplebar/dist/simplebar.css", - "./node_modules/simplebar/dist/simplebar.js", + "simplebar/dist/simplebar.css", + "simplebar/dist/simplebar.js", "./static/js/portico/help.js", "./static/js/portico/tabbed-instructions.js" ], - "katex": "./node_modules/katex/dist/katex.min.js", + "katex": "katex/dist/katex.min.js", "landing-page": [ "./static/js/portico/landing-page.js", "./static/styles/portico/landing-page.scss" @@ -80,7 +80,7 @@ "./static/styles/portico/integrations.scss" ], "signup": [ - "./node_modules/jquery-validation/dist/jquery.validate.min.js", + "jquery-validation/dist/jquery.validate.min.js", "./static/js/portico/signup.js" ], "support": [ @@ -100,13 +100,13 @@ "stats": [ "./static/styles/portico/stats.scss", "./static/js/stats/stats.js", - "./node_modules/plotly.js/dist/plotly-basic.min.js" + "plotly.js/dist/plotly-basic.min.js" ], "translations": "./static/js/translations.js", - "zxcvbn": "./node_modules/zxcvbn/dist/zxcvbn.js", + "zxcvbn": "zxcvbn/dist/zxcvbn.js", "app": "./static/js/bundles/app.js", "archive-styles": [ - "./node_modules/katex/dist/katex.css", + "katex/dist/katex.css", "./static/styles/zulip.scss", "./static/styles/media.scss", "./static/styles/portico/archive.scss" diff --git a/tools/webpack.config.ts b/tools/webpack.config.ts index ce5a487ad8..7ede4eb1d6 100644 --- a/tools/webpack.config.ts +++ b/tools/webpack.config.ts @@ -125,22 +125,22 @@ export default (env?: string): webpack.Configuration => { // Use the unminified versions of jquery and underscore so that // Good error messages show up in production and development in the source maps var exposeOptions = [ - { path: "../node_modules/blueimp-md5/js/md5.js" }, - { path: "../node_modules/clipboard/dist/clipboard.js", name: "ClipboardJS" }, - { path: "../node_modules/xdate/src/xdate.js", name: "XDate" }, - { path: "../node_modules/simplebar/dist/simplebar.js"}, + { path: "blueimp-md5/js/md5.js" }, + { path: "clipboard/dist/clipboard.js", name: "ClipboardJS" }, + { path: "xdate/src/xdate.js", name: "XDate" }, + { path: "simplebar/dist/simplebar.js"}, { path: "../static/third/marked/lib/marked.js" }, { path: "../static/generated/emoji/emoji_codes.js" }, { path: "../static/generated/pygments_data.js" }, { path: "../static/js/debug.js" }, { path: "../static/js/blueslip.js" }, { path: "../static/js/common.js" }, - { path: "../node_modules/jquery/dist/jquery.js", name: ['$', 'jQuery'] }, - { path: "../node_modules/underscore/underscore.js", name: '_' }, - { path: "../node_modules/handlebars/dist/handlebars.runtime.js", name: 'Handlebars' }, - { path: "../node_modules/to-markdown/dist/to-markdown.js", name: 'toMarkdown' }, - { path: "../node_modules/sortablejs/Sortable.js"}, - { path: "../node_modules/winchan/winchan.js", name: 'WinChan'}, + { path: "jquery/dist/jquery.js", name: ['$', 'jQuery'] }, + { path: "underscore/underscore.js", name: '_' }, + { path: "handlebars/dist/handlebars.runtime.js", name: 'Handlebars' }, + { path: "to-markdown/dist/to-markdown.js", name: 'toMarkdown' }, + { path: "sortablejs/Sortable.js"}, + { path: "winchan/winchan.js", name: 'WinChan'}, ]; config.module.rules.push(...getExposeLoaders(exposeOptions));