Permalink
Browse files

perf: import only needed lodash functions (#14, @leahciMic)

This module imports the entirety of Lodash which is very large. This results in large bundle sizes for anyone consuming this module.

This PR imports only the merge function from Lodash.
  • Loading branch information...
leahciMic authored and pi0 committed Nov 9, 2017
1 parent 110f158 commit fc6ae6863deae8880cfc9247aa19c8900f573259
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/index.js
  2. +1 −1 templates/auth.store.js
@@ -1,5 +1,5 @@
const { resolve } = require('path')
const { merge } = require('lodash')
const merge = require('lodash/merge')
export default async function module (moduleOptions) {
// Apply defaults
@@ -1,6 +1,6 @@
import Cookie from 'cookie'
import Cookies from 'js-cookie'
import { kebabCase } from 'lodash'
import kebabCase from 'lodash/kebabCase'
const options = <%= serialize(options) %>
const storageTokenName = kebabCase(options.storageTokenName)

0 comments on commit fc6ae68

Please sign in to comment.