Skip to content

Commit

Permalink
Correct the lodash import for tree shaking (valor-software#1123)
Browse files Browse the repository at this point in the history
* Correct the lodash import for tree shaking

* move to lodash-es for tree shaking

* hoist lodash-es for demo project

* set ng analytics to ci

* bump node version for angular cli 8
  • Loading branch information
philjones88 authored and Domainv committed Nov 6, 2019
1 parent 3d1fb9d commit 143ba2d
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
dist: trusty
sudo: false

language: node_js

env:
- NG_CLI_ANALYTICS="ci"

node_js: "10"


addons:
apt:
sources:
Expand Down
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"chartjs-plugin-datalabels": "^0.6.0",
"core-js": "^3.1.3",
"highlight.js": "^9.15.8",
"lodash-es": "^4.17.11",
"luxon": "^1.15.0",
"marked": "^0.6.2",
"ngx-highlightjs": "^3.0.3",
Expand All @@ -58,6 +59,7 @@
"@types/chart.js": "^2.7.53",
"@types/jasmine": "^3.3.13",
"@types/jasminewd2": "~2.0.3",
"@types/lodash-es": "^4.17.3",
"@types/node": "^12.0.3",
"codelyzer": "~4.5.0",
"cypress": "^3.4.1",
Expand Down
4 changes: 2 additions & 2 deletions projects/ng2-charts/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"entryFile": "src/public_api.ts",
"umdModuleIds": {
"chart.js": "chart_js",
"lodash": "_"
"lodash-es": "_"
}
},
"whitelistedNonPeerDependencies": [
"@types/chart.js",
"lodash"
"lodash-es"
]
}
15 changes: 12 additions & 3 deletions projects/ng2-charts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions projects/ng2-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
},
"dependencies": {
"@types/chart.js": "^2.7.48",
"lodash": "^4.17.11"
"lodash-es": "^4.17.11"
},
"description": "Reactive, responsive, beautiful charts for Angular2 based on Chart.js",
"main": "src/public_api.ts",
"devDependencies": {
"@types/lodash": "^4.14.123"
"@types/lodash-es": "^4.17.3"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
2 changes: 1 addition & 1 deletion projects/ng2-charts/src/lib/base-chart.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { getColors } from './get-colors';
import { Color } from './color';
import { ThemeService } from './theme.service';
import { Subscription } from 'rxjs';
import { cloneDeep } from 'lodash';
import { cloneDeep } from 'lodash-es';

export type SingleDataSet = (number[] | chartJs.ChartPoint[]);
export type MultiDataSet = (number[] | chartJs.ChartPoint[])[];
Expand Down

0 comments on commit 143ba2d

Please sign in to comment.