Use specific methods from lodash to reduce bundle size
This commit is contained in:
parent
17d86a2832
commit
b2acd1e8a8
|
@ -52,7 +52,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
import { WebSocketBridge } from 'django-channels'
|
import { WebSocketBridge } from 'django-channels'
|
||||||
import GlobalEvents from '@/components/utils/global-events'
|
import GlobalEvents from '@/components/utils/global-events'
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from "lodash"
|
import _ from "@/lodash"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import logger from '@/logging'
|
import logger from '@/logging'
|
||||||
import AlbumCard from '@/components/audio/album/Card'
|
import AlbumCard from '@/components/audio/album/Card'
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import url from '@/utils/url'
|
import url from '@/utils/url'
|
||||||
import {Howl} from 'howler'
|
import {Howl} from 'howler'
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import PlayButton from '@/components/audio/PlayButton'
|
import PlayButton from '@/components/audio/PlayButton'
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import PlayButton from '@/components/audio/PlayButton'
|
import PlayButton from '@/components/audio/PlayButton'
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import '../../../style/vendor/media';
|
@import "../../../style/vendor/media";
|
||||||
|
|
||||||
.play-overlay {
|
.play-overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import LibraryCard from '@/views/content/remote/Card'
|
import LibraryCard from '@/views/content/remote/Card'
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import logger from '@/logging'
|
import logger from '@/logging'
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from "lodash"
|
import _ from "@/lodash"
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import logger from "@/logging"
|
import logger from "@/logging"
|
||||||
import backend from "@/audio/backend"
|
import backend from "@/audio/backend"
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import _ from "lodash"
|
import _ from "@/lodash"
|
||||||
import $ from "jquery"
|
import $ from "jquery"
|
||||||
|
|
||||||
import logger from "@/logging"
|
import logger from "@/logging"
|
||||||
|
|
|
@ -123,6 +123,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import _ from "@/lodash"
|
||||||
import $ from "jquery";
|
import $ from "jquery";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import logger from "@/logging";
|
import logger from "@/logging";
|
||||||
|
|
|
@ -92,7 +92,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import _ from "lodash"
|
import _ from "@/lodash"
|
||||||
import $ from "jquery"
|
import $ from "jquery"
|
||||||
|
|
||||||
import logger from "@/logging"
|
import logger from "@/logging"
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
<script>
|
<script>
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import $ from "jquery"
|
import $ from "jquery"
|
||||||
import _ from "lodash"
|
import _ from "@/lodash"
|
||||||
import BuilderFilter from "./Filter"
|
import BuilderFilter from "./Filter"
|
||||||
import TrackTable from "@/components/audio/track/Table"
|
import TrackTable from "@/components/audio/track/Table"
|
||||||
import RadioButton from "@/components/radios/Button"
|
import RadioButton from "@/components/radios/Button"
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
|
|
||||||
import Modal from '@/components/semantic/Modal'
|
import Modal from '@/components/semantic/Modal'
|
||||||
import TrackTable from '@/components/audio/track/Table'
|
import TrackTable from '@/components/audio/track/Table'
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import time from '@/utils/time'
|
import time from '@/utils/time'
|
||||||
import Pagination from '@/components/Pagination'
|
import Pagination from '@/components/Pagination'
|
||||||
import ActionTable from '@/components/common/ActionTable'
|
import ActionTable from '@/components/common/ActionTable'
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import Pagination from '@/components/Pagination'
|
import Pagination from '@/components/Pagination'
|
||||||
import ActionTable from '@/components/common/ActionTable'
|
import ActionTable from '@/components/common/ActionTable'
|
||||||
import OrderingMixin from '@/components/mixins/Ordering'
|
import OrderingMixin from '@/components/mixins/Ordering'
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import time from '@/utils/time'
|
import time from '@/utils/time'
|
||||||
import Pagination from '@/components/Pagination'
|
import Pagination from '@/components/Pagination'
|
||||||
import ActionTable from '@/components/common/ActionTable'
|
import ActionTable from '@/components/common/ActionTable'
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import PlaylistCard from '@/components/playlists/Card'
|
import PlaylistCard from '@/components/playlists/Card'
|
||||||
|
|
||||||
|
|
|
@ -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'),
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import logger from '@/logging'
|
import logger from '@/logging'
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
|
|
||||||
function getDefaultUrl () {
|
function getDefaultUrl () {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import logger from '@/logging'
|
import logger from '@/logging'
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
|
|
|
@ -120,7 +120,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
import time from '@/utils/time'
|
import time from '@/utils/time'
|
||||||
import {normalizeQuery, parseTokens, compileTokens} from '@/search'
|
import {normalizeQuery, parseTokens, compileTokens} from '@/search'
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import _ from "lodash"
|
import _ from "@/lodash"
|
||||||
import $ from "jquery"
|
import $ from "jquery"
|
||||||
|
|
||||||
import OrderingMixin from "@/components/mixins/Ordering"
|
import OrderingMixin from "@/components/mixins/Ordering"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
var sinon = require('sinon')
|
var sinon = require('sinon')
|
||||||
import {expect} from 'chai'
|
import {expect} from 'chai'
|
||||||
|
|
||||||
import _ from 'lodash'
|
import _ from '@/lodash'
|
||||||
|
|
||||||
import store from '@/store/queue'
|
import store from '@/store/queue'
|
||||||
import { testAction } from '../../utils'
|
import { testAction } from '../../utils'
|
||||||
|
|
Loading…
Reference in New Issue