removed lodash and added lodash-es dependency: now tree shaking on lodash is supported (IMPORTANT: devDependency @rollup/plugin-commonjs need to be at version 11.0.2 to make things work correctly); updated packages

This commit is contained in:
Roberto Tonino
2020-06-03 20:49:19 +02:00
parent da657bbdcc
commit db685df7c2
7 changed files with 45 additions and 96 deletions

View File

@@ -1,4 +1,4 @@
import _ from 'lodash'
import { isEmpty, orderBy } from 'lodash-es'
import Vue from 'vue'
import { socket } from '../socket.js'
import Downloads from '../downloads.js'
@@ -73,7 +73,7 @@ const ArtistTab = new Vue({
{ title: 'Release Date', sortKey: 'release_date' },
{ title: '', width: '32px' }
]
if (_.isEmpty(releases)) {
if (isEmpty(releases)) {
this.body = null
} else {
this.body = releases
@@ -82,7 +82,7 @@ const ArtistTab = new Vue({
},
computed: {
showTable() {
if (this.body) return _.orderBy(this.body[this.currentTab], this.sortKey, this.sortOrder)
if (this.body) return orderBy(this.body[this.currentTab], this.sortKey, this.sortOrder)
else return []
}
},

View File

@@ -1,4 +1,4 @@
import _ from 'lodash'
import { isEmpty } from 'lodash-es'
import Vue from 'vue'
import { socket } from '../socket.js'
import { showView } from '../tabs.js'
@@ -79,7 +79,7 @@ const TracklistTab = new Vue({
this.release_date = release_date.substring(0, 10)
this.image = cover_xl
if (_.isEmpty(albumTracks)) {
if (isEmpty(albumTracks)) {
this.body = null
} else {
this.body = albumTracks
@@ -103,7 +103,7 @@ const TracklistTab = new Vue({
this.release_date = creation_date.substring(0, 10)
this.metadata = `by ${creatorName}${numberOfTracks} songs`
if (_.isEmpty(playlistTracks)) {
if (isEmpty(playlistTracks)) {
this.body = null
} else {
this.body = playlistTracks
@@ -129,7 +129,7 @@ const TracklistTab = new Vue({
this.release_date = ''
this.metadata = `by ${ownerName}${numberOfTracks} songs`
if (_.isEmpty(playlistTracks)) {
if (isEmpty(playlistTracks)) {
this.body = null
} else {
this.body = playlistTracks