Skip to content

Commit

Permalink
refactor: new target browsers (#841)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: New target browsers: ie 11 dropped for regular bundle, modern bundle builds for
browsers with es6 modules support.
  • Loading branch information
dangreen committed Nov 4, 2021
1 parent b64dfb0 commit b1e83db
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .size-limit
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[
{
"path": "dist/index.js",
"limit": "2.5 KB",
"path": "dist/index.cjs",
"limit": "1.6 KB",
"webpack": false,
"running": false
},
{
"path": "dist/index.js",
"limit": "1.5 KB",
"path": "dist/index.cjs",
"limit": "900 B",
"import": "{ Chart }"
},
{
"path": "dist/index.modern.js",
"limit": "2.35 KB",
"limit": "1.5 KB",
"webpack": false,
"running": false
},
{
"path": "dist/index.modern.js",
"limit": "1.5 KB",
"limit": "800 B",
"import": "{ Chart }"
}
]
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"name": "react-chartjs-2",
"version": "3.3.0",
"description": "React components for Chart.js",
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/index.modern.js",
"types": "dist/index.d.ts",
"author": "Jeremy Ayerst",
"homepage": "https://github.com/reactchartjs/react-chartjs-2",
"license": "MIT",
Expand All @@ -16,6 +12,10 @@
"bugs": {
"url": "https://github.com/reactchartjs/react-chartjs-2/issues"
},
"sideEffects": false,
"main": "dist/index.cjs",
"module": "dist/index.modern.js",
"types": "dist/index.d.ts",
"keywords": [
"chart",
"chart-js",
Expand Down
8 changes: 4 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import pkg from './package.json';

const extensions = ['.js', '.ts', '.tsx'];
const external = _ => /node_modules/.test(_) && !/@swc\/helpers/.test(_);
const plugins = [
const plugins = targets => [
nodeResolve({
extensions,
}),
Expand All @@ -22,7 +22,7 @@ const plugins = [
externalHelpers: true,
},
env: {
targets: 'defaults',
targets,
},
module: {
type: 'es6',
Expand All @@ -34,7 +34,7 @@ const plugins = [
export default [
{
input: 'src/index.tsx',
plugins,
plugins: plugins('defaults, not ie 11, not ie_mob 11'),
external,
output: {
file: pkg.main,
Expand All @@ -45,7 +45,7 @@ export default [
},
{
input: 'src/index.tsx',
plugins,
plugins: plugins('defaults and supports es6-module'),
external,
output: {
file: pkg.module,
Expand Down

0 comments on commit b1e83db

Please sign in to comment.