Skip to content

Commit b1e83db

Browse files
authored
refactor: new target browsers (#841)
BREAKING CHANGE: New target browsers: ie 11 dropped for regular bundle, modern bundle builds for browsers with es6 modules support.
1 parent b64dfb0 commit b1e83db

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

Diff for: .size-limit

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
[
22
{
3-
"path": "dist/index.js",
4-
"limit": "2.5 KB",
3+
"path": "dist/index.cjs",
4+
"limit": "1.6 KB",
55
"webpack": false,
66
"running": false
77
},
88
{
9-
"path": "dist/index.js",
10-
"limit": "1.5 KB",
9+
"path": "dist/index.cjs",
10+
"limit": "900 B",
1111
"import": "{ Chart }"
1212
},
1313
{
1414
"path": "dist/index.modern.js",
15-
"limit": "2.35 KB",
15+
"limit": "1.5 KB",
1616
"webpack": false,
1717
"running": false
1818
},
1919
{
2020
"path": "dist/index.modern.js",
21-
"limit": "1.5 KB",
21+
"limit": "800 B",
2222
"import": "{ Chart }"
2323
}
2424
]

Diff for: package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
"name": "react-chartjs-2",
33
"version": "3.3.0",
44
"description": "React components for Chart.js",
5-
"sideEffects": false,
6-
"main": "dist/index.js",
7-
"module": "dist/index.modern.js",
8-
"types": "dist/index.d.ts",
95
"author": "Jeremy Ayerst",
106
"homepage": "https://github.com/reactchartjs/react-chartjs-2",
117
"license": "MIT",
@@ -16,6 +12,10 @@
1612
"bugs": {
1713
"url": "https://github.com/reactchartjs/react-chartjs-2/issues"
1814
},
15+
"sideEffects": false,
16+
"main": "dist/index.cjs",
17+
"module": "dist/index.modern.js",
18+
"types": "dist/index.d.ts",
1919
"keywords": [
2020
"chart",
2121
"chart-js",

Diff for: rollup.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import pkg from './package.json';
44

55
const extensions = ['.js', '.ts', '.tsx'];
66
const external = _ => /node_modules/.test(_) && !/@swc\/helpers/.test(_);
7-
const plugins = [
7+
const plugins = targets => [
88
nodeResolve({
99
extensions,
1010
}),
@@ -22,7 +22,7 @@ const plugins = [
2222
externalHelpers: true,
2323
},
2424
env: {
25-
targets: 'defaults',
25+
targets,
2626
},
2727
module: {
2828
type: 'es6',
@@ -34,7 +34,7 @@ const plugins = [
3434
export default [
3535
{
3636
input: 'src/index.tsx',
37-
plugins,
37+
plugins: plugins('defaults, not ie 11, not ie_mob 11'),
3838
external,
3939
output: {
4040
file: pkg.main,
@@ -45,7 +45,7 @@ export default [
4545
},
4646
{
4747
input: 'src/index.tsx',
48-
plugins,
48+
plugins: plugins('defaults and supports es6-module'),
4949
external,
5050
output: {
5151
file: pkg.module,

0 commit comments

Comments
 (0)