Skip to content

Commit

Permalink
Back to dist, remove minified esm build
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed May 22, 2020
1 parent 532b3cd commit d2c3107
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 48 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
/custom
/dist
/gh-pages
chart*.js
chunk*.js
/helpers

# Node.js
Expand Down
14 changes: 6 additions & 8 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"env": {
"umd": {
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-object-assign"
]
},
Expand All @@ -21,14 +23,10 @@
"useBuiltIns": false
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
},
"test": {
"plugins": [
"@babel/plugin-proposal-class-properties",
"istanbul"
]
}
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"description": "Simple HTML5 charts using the canvas element.",
"version": "3.0.0-alpha",
"license": "MIT",
"jsdelivr": "chart.min.js",
"unpkg": "chart.min.js",
"main": "chart.js",
"module": "chart.esm.js",
"jsdelivr": "dist/chart.min.js",
"unpkg": "dist/chart.min.js",
"main": "dist/chart.js",
"module": "dist/chart.esm.js",
"keywords": [
"canvas",
"charts",
Expand All @@ -24,8 +24,7 @@
"url": "https://github.com/chartjs/Chart.js/issues"
},
"files": [
"composer.json",
"chart*.js",
"dist/*.js",
"helpers/*.js"
],
"scripts": {
Expand Down
42 changes: 10 additions & 32 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const pkg = require('./package.json');

const input = 'src/index.js';
const inputESM = {
'chart.esm': 'src/index.esm.js',
'dist/chart.esm': 'src/index.esm.js',
'helpers/canvas': 'src/helpers/helpers.canvas.js',
'helpers/collection': 'src/helpers/helpers.collection.js',
'helpers/color': 'src/helpers/helpers.color.js',
Expand All @@ -36,8 +36,8 @@ const banner = `/*!

module.exports = [
// UMD builds
// chart.min.js
// chart.js
// dist/chart.min.js
// dist/chart.js
{
input,
plugins: [
Expand All @@ -52,8 +52,8 @@ module.exports = [
})
],
output: {
name: 'chart',
file: 'chart.js',
name: 'Chart',
file: 'dist/chart.js',
banner,
format: 'umd',
indent: false,
Expand All @@ -75,17 +75,15 @@ module.exports = [
})
],
output: {
name: 'chart',
file: 'chart.min.js',
name: 'Chart',
file: 'dist/chart.min.js',
format: 'umd',
indent: false,
},
},

// ES6 builds
// chart.esm.min.js
// helpers/*.min.js
// chart.esm.js
// dist/chart.esm.js
// helpers/*.js
{
input: inputESM,
Expand All @@ -99,30 +97,10 @@ module.exports = [
],
output: {
dir: './',
chunkFileNames: 'chunk-[name].js',
chunkFileNames: 'helpers/[name].js',
banner,
format: 'esm',
indent: false,
},
},
{
input: inputESM,
plugins: [
json(),
resolve(),
babel({envName: 'es6'}),
terser({
output: {
preamble: banner
}
})
],
output: {
dir: './',
entryFileNames: '[name].min.js',
chunkFileNames: 'chunk-[name].min.js',
format: 'esm',
indent: false,
},
},
}
];

0 comments on commit d2c3107

Please sign in to comment.