diff --git a/front/src/App.vue b/front/src/App.vue index 55cfab6e9f6dfc00660c3fcbb9dff48492fa1462..d61e5a83752c350ddc12992cebd6c4b4c932e3c8 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -52,7 +52,7 @@ <script> import axios from 'axios' -import _ from 'lodash' +import _ from '@/lodash' import {mapState} from 'vuex' import { WebSocketBridge } from 'django-channels' import GlobalEvents from '@/components/utils/global-events' diff --git a/front/src/components/Pagination.vue b/front/src/components/Pagination.vue index 1064a827e8a7c82aaf4145b2db2540d454b96fc5..57cac2815a0701ca66bb17c086d7e2d2033e02b4 100644 --- a/front/src/components/Pagination.vue +++ b/front/src/components/Pagination.vue @@ -24,7 +24,7 @@ </template> <script> -import _ from "lodash" +import _ from "@/lodash" export default { props: { diff --git a/front/src/components/audio/Search.vue b/front/src/components/audio/Search.vue index 06ae2c1cc7636020b3cd6710b2c3c8c81e56b9c4..e21a569bd902a019fcb41a0547eb1423f0323216 100644 --- a/front/src/components/audio/Search.vue +++ b/front/src/components/audio/Search.vue @@ -29,7 +29,7 @@ </template> <script> -import _ from 'lodash' +import _ from '@/lodash' import axios from 'axios' import logger from '@/logging' import AlbumCard from '@/components/audio/album/Card' diff --git a/front/src/components/audio/Track.vue b/front/src/components/audio/Track.vue index c847d4de1a69f3f6cd1e6937e580d8ddf23332da..888a81c007cd8e1ceb401786d380abde83cfc975 100644 --- a/front/src/components/audio/Track.vue +++ b/front/src/components/audio/Track.vue @@ -4,7 +4,7 @@ <script> import {mapState} from 'vuex' -import _ from 'lodash' +import _ from '@/lodash' import url from '@/utils/url' import {Howl} from 'howler' diff --git a/front/src/components/audio/album/Widget.vue b/front/src/components/audio/album/Widget.vue index ccef492955f7a1b0499686993cc8bcece202a630..53f569c13baf994e00bb5f24fbd794b0f3833f87 100644 --- a/front/src/components/audio/album/Widget.vue +++ b/front/src/components/audio/album/Widget.vue @@ -36,7 +36,7 @@ </template> <script> -import _ from 'lodash' +import _ from '@/lodash' import axios from 'axios' import PlayButton from '@/components/audio/PlayButton' diff --git a/front/src/components/audio/track/Widget.vue b/front/src/components/audio/track/Widget.vue index 5ed28098102152a55f893b8d914168e1f4db4a2b..f909945f0f97119fcb3ab3a36d8943bfe9513a3b 100644 --- a/front/src/components/audio/track/Widget.vue +++ b/front/src/components/audio/track/Widget.vue @@ -47,7 +47,7 @@ </template> <script> -import _ from 'lodash' +import _ from '@/lodash' import axios from 'axios' import PlayButton from '@/components/audio/PlayButton' @@ -109,7 +109,7 @@ export default { </script> <style scoped lang="scss"> -@import '../../../style/vendor/media'; +@import "../../../style/vendor/media"; .play-overlay { position: absolute; diff --git a/front/src/components/federation/LibraryWidget.vue b/front/src/components/federation/LibraryWidget.vue index abe993e4662a01cda6feb10f6f97d19bcdb26ea4..0902b1b9d1ca04f9e6647d445b103f7cea3b39dc 100644 --- a/front/src/components/federation/LibraryWidget.vue +++ b/front/src/components/federation/LibraryWidget.vue @@ -26,7 +26,7 @@ </template> <script> -import _ from 'lodash' +import _ from '@/lodash' import axios from 'axios' import LibraryCard from '@/views/content/remote/Card' diff --git a/front/src/components/instance/Stats.vue b/front/src/components/instance/Stats.vue index bb23b617c29cc43d3ef8484866d264c23068d026..78632f6d23fa38702d1edefd78527bfd2d762f22 100644 --- a/front/src/components/instance/Stats.vue +++ b/front/src/components/instance/Stats.vue @@ -61,7 +61,7 @@ </template> <script> -import _ from 'lodash' +import _ from '@/lodash' import axios from 'axios' import logger from '@/logging' diff --git a/front/src/components/library/Artist.vue b/front/src/components/library/Artist.vue index e16e6728d50f2f4f597f87bb6f8e2211c4f3bc0e..1cebafd8da78b32f7dc4059f18121103af6edc90 100644 --- a/front/src/components/library/Artist.vue +++ b/front/src/components/library/Artist.vue @@ -69,7 +69,7 @@ </template> <script> -import _ from "lodash" +import _ from "@/lodash" import axios from "axios" import logger from "@/logging" import backend from "@/audio/backend" diff --git a/front/src/components/library/Artists.vue b/front/src/components/library/Artists.vue index 83dd0e8e263797af0eb3c8caa2f808427eced4d8..f6fcc1b8b893ff4dc5bdc9664caec788381ee7ce 100644 --- a/front/src/components/library/Artists.vue +++ b/front/src/components/library/Artists.vue @@ -70,7 +70,7 @@ <script> import axios from "axios" -import _ from "lodash" +import _ from "@/lodash" import $ from "jquery" import logger from "@/logging" diff --git a/front/src/components/library/FileUpload.vue b/front/src/components/library/FileUpload.vue index 0dbe4a4b67a7927f45e8c4e77c5550bc39a82543..d2c93202f63cfd3729a1b322680853974c0c8fcd 100644 --- a/front/src/components/library/FileUpload.vue +++ b/front/src/components/library/FileUpload.vue @@ -123,6 +123,7 @@ </template> <script> +import _ from "@/lodash" import $ from "jquery"; import axios from "axios"; import logger from "@/logging"; diff --git a/front/src/components/library/Radios.vue b/front/src/components/library/Radios.vue index 48e9b1e2f324e8027f97013d04fc353f8eaca042..42a825d230d2e71bd05f2728faa5994a0b8beaaf 100644 --- a/front/src/components/library/Radios.vue +++ b/front/src/components/library/Radios.vue @@ -92,7 +92,7 @@ <script> import axios from "axios" -import _ from "lodash" +import _ from "@/lodash" import $ from "jquery" import logger from "@/logging" diff --git a/front/src/components/library/radios/Builder.vue b/front/src/components/library/radios/Builder.vue index b0157497987c8b6545cfab6eb819e8488194980e..5698a71f422d44568c6cfa63ff42f0edd9ca9be3 100644 --- a/front/src/components/library/radios/Builder.vue +++ b/front/src/components/library/radios/Builder.vue @@ -94,7 +94,7 @@ <script> import axios from "axios" import $ from "jquery" -import _ from "lodash" +import _ from "@/lodash" import BuilderFilter from "./Filter" import TrackTable from "@/components/audio/track/Table" import RadioButton from "@/components/radios/Button" diff --git a/front/src/components/library/radios/Filter.vue b/front/src/components/library/radios/Filter.vue index 470d852fadfda8f5e292e8d256584d550d55cc8c..5fd7eec893dfd5bf56ed39d2e3d1887a580be715 100644 --- a/front/src/components/library/radios/Filter.vue +++ b/front/src/components/library/radios/Filter.vue @@ -64,7 +64,7 @@ <script> import axios from 'axios' import $ from 'jquery' -import _ from 'lodash' +import _ from '@/lodash' import Modal from '@/components/semantic/Modal' import TrackTable from '@/components/audio/track/Table' diff --git a/front/src/components/manage/library/FilesTable.vue b/front/src/components/manage/library/FilesTable.vue index 1f5fc397640ccc59e2e62bb38926c500f5872d01..bcee39ffde2ac44369f4128de4390ce41986bb4c 100644 --- a/front/src/components/manage/library/FilesTable.vue +++ b/front/src/components/manage/library/FilesTable.vue @@ -106,7 +106,7 @@ <script> import axios from 'axios' -import _ from 'lodash' +import _ from '@/lodash' import time from '@/utils/time' import Pagination from '@/components/Pagination' import ActionTable from '@/components/common/ActionTable' diff --git a/front/src/components/manage/users/InvitationsTable.vue b/front/src/components/manage/users/InvitationsTable.vue index d697c3821d7a7b019fcb9e12c3ba01d6401f7834..0c8b15c18134e3af560f56aa950f11d4b9b59f8e 100644 --- a/front/src/components/manage/users/InvitationsTable.vue +++ b/front/src/components/manage/users/InvitationsTable.vue @@ -86,7 +86,7 @@ <script> import axios from 'axios' import moment from 'moment' -import _ from 'lodash' +import _ from '@/lodash' import Pagination from '@/components/Pagination' import ActionTable from '@/components/common/ActionTable' import OrderingMixin from '@/components/mixins/Ordering' diff --git a/front/src/components/manage/users/UsersTable.vue b/front/src/components/manage/users/UsersTable.vue index cb46ed811fbdcb228b8de252f949f40f44fd2d10..33b2433cb5c4b1f6917d151a9d972421d024edab 100644 --- a/front/src/components/manage/users/UsersTable.vue +++ b/front/src/components/manage/users/UsersTable.vue @@ -96,7 +96,7 @@ <script> import axios from 'axios' -import _ from 'lodash' +import _ from '@/lodash' import time from '@/utils/time' import Pagination from '@/components/Pagination' import ActionTable from '@/components/common/ActionTable' diff --git a/front/src/components/playlists/PlaylistModal.vue b/front/src/components/playlists/PlaylistModal.vue index a5a7e9ea0234c96ecea210c49e1e1444a305296a..3065631afb376deb5473d98188c81daf6a903aaf 100644 --- a/front/src/components/playlists/PlaylistModal.vue +++ b/front/src/components/playlists/PlaylistModal.vue @@ -67,7 +67,7 @@ </template> <script> -import _ from 'lodash' +import _ from '@/lodash' import axios from 'axios' import {mapState} from 'vuex' diff --git a/front/src/components/playlists/Widget.vue b/front/src/components/playlists/Widget.vue index 868719f1c2536b4b480c4ca0fd3365415222a88a..c289e6de9fafaa506a6398070beb251a0ba5ed50 100644 --- a/front/src/components/playlists/Widget.vue +++ b/front/src/components/playlists/Widget.vue @@ -15,7 +15,7 @@ </template> <script> -import _ from 'lodash' +import _ from '@/lodash' import axios from 'axios' import PlaylistCard from '@/components/playlists/Card' diff --git a/front/src/lodash.js b/front/src/lodash.js new file mode 100644 index 0000000000000000000000000000000000000000..91e1a0eac30bdf5104a18913578bafcb35298fa6 --- /dev/null +++ b/front/src/lodash.js @@ -0,0 +1,13 @@ +// cherry-pick specific lodash methods here to reduce bundle size + +export default { + clone: require('lodash/clone'), + debounce: require('lodash/debounce'), + get: require('lodash/get'), + merge: require('lodash/merge'), + range: require('lodash/range'), + shuffle: require('lodash/shuffle'), + sortBy: require('lodash/sortBy'), + throttle: require('lodash/throttle'), + uniq: require('lodash/uniq'), +} diff --git a/front/src/store/instance.js b/front/src/store/instance.js index 72a960cd05db64b21ff8585cc32a48112d94aef4..dd0de956b49716b8152ab0af46b8b71ee15787d9 100644 --- a/front/src/store/instance.js +++ b/front/src/store/instance.js @@ -1,6 +1,6 @@ import axios from 'axios' import logger from '@/logging' -import _ from 'lodash' +import _ from '@/lodash' function getDefaultUrl () { return ( diff --git a/front/src/store/queue.js b/front/src/store/queue.js index dba102b4669acf11a710724341f196483c5bae35..9a0d55c0bf47f0f80ee02c18e33253dc1626d5be 100644 --- a/front/src/store/queue.js +++ b/front/src/store/queue.js @@ -1,5 +1,5 @@ import logger from '@/logging' -import _ from 'lodash' +import _ from '@/lodash' export default { namespaced: true, diff --git a/front/src/views/content/libraries/FilesTable.vue b/front/src/views/content/libraries/FilesTable.vue index 21ad79e7200ae5776b995087bdbd897a545af847..1f176d8cbba59648b9da2efbb0493850b657c4d7 100644 --- a/front/src/views/content/libraries/FilesTable.vue +++ b/front/src/views/content/libraries/FilesTable.vue @@ -120,7 +120,7 @@ <script> import axios from 'axios' -import _ from 'lodash' +import _ from '@/lodash' import time from '@/utils/time' import {normalizeQuery, parseTokens, compileTokens} from '@/search' diff --git a/front/src/views/playlists/List.vue b/front/src/views/playlists/List.vue index de9ca78ac74d19ec05d4b3b0446eae06bcd36973..64c78d72b0222dc3901f2e2b8231a0c780146243 100644 --- a/front/src/views/playlists/List.vue +++ b/front/src/views/playlists/List.vue @@ -56,7 +56,7 @@ <script> import axios from "axios" -import _ from "lodash" +import _ from "@/lodash" import $ from "jquery" import OrderingMixin from "@/components/mixins/Ordering" diff --git a/front/tests/unit/specs/store/queue.spec.js b/front/tests/unit/specs/store/queue.spec.js index 3fa481d1931a94b596bb09429e695711f4bb85eb..140ce071a073ec722753c622b3e29384fe880072 100644 --- a/front/tests/unit/specs/store/queue.spec.js +++ b/front/tests/unit/specs/store/queue.spec.js @@ -1,7 +1,7 @@ var sinon = require('sinon') import {expect} from 'chai' -import _ from 'lodash' +import _ from '@/lodash' import store from '@/store/queue' import { testAction } from '../../utils'