]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Optimize the npm package by removing useless files (#6105)
authorSimon Brunel <simonbrunel@users.noreply.github.com>
Sun, 3 Mar 2019 14:19:11 +0000 (15:19 +0100)
committerGitHub <noreply@github.com>
Sun, 3 Mar 2019 14:19:11 +0000 (15:19 +0100)
Explicitly target files that should be included in the npm package, making it 10x smaller by removing the docs, samples, scripts, sources, tests and other useless files.

.npmignore [deleted file]
karma.conf.js
package.json
rollup.config.js
src/index.js [moved from src/chart.js with 100% similarity]
src/scales/scale.category.js
src/scales/scale.linear.js
src/scales/scale.logarithmic.js
src/scales/scale.radialLinear.js
src/scales/scale.time.js

diff --git a/.npmignore b/.npmignore
deleted file mode 100644 (file)
index 47b4948..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/.git
-/.github
-/coverage
-/custom
-/dist/*.zip
-/docs/index.md
-/node_modules
-
-.codeclimate.yml
-.DS_Store
-.gitignore
-.idea
-.travis.yml
index 02878567571bf8a4fdbc88cc634b58b0a76dcd3a..d7aae642a2e7d1185e402e9be83c3a6a100b368e 100644 (file)
@@ -49,12 +49,12 @@ module.exports = function(karma) {
                        {pattern: 'test/fixtures/**/*.png', included: false},
                        'node_modules/moment/min/moment.min.js',
                        'test/index.js',
-                       'src/chart.js'
+                       'src/index.js'
                ].concat(args.inputs),
 
                preprocessors: {
                        'test/index.js': ['rollup'],
-                       'src/chart.js': ['sources']
+                       'src/index.js': ['sources']
                },
 
                rollupPreprocessor: {
index 72c359debf43a025243bbfe443668a2676d0bfb2..5d16f9323cc2f859367544defdfa9e14416f7b0f 100644 (file)
   "bugs": {
     "url": "https://github.com/chartjs/Chart.js/issues"
   },
+  "files": [
+    "bower.json",
+    "composer.json",
+    "dist/*.css",
+    "dist/*.js"
+  ],
   "devDependencies": {
     "clean-css": "^4.2.1",
     "coveralls": "^3.0.0",
index 1f0dbbacac5d55f2da9e61f0483ceb4b9004f95d..fc53f1a74606473988be19ff58c093a25f87a794 100644 (file)
@@ -7,7 +7,7 @@ const optional = require('./rollup.plugins').optional;
 const stylesheet = require('./rollup.plugins').stylesheet;
 const pkg = require('./package.json');
 
-const input = 'src/chart.js';
+const input = 'src/index.js';
 const banner = `/*!
  * Chart.js v${pkg.version}
  * ${pkg.homepage}
similarity index 100%
rename from src/chart.js
rename to src/index.js
index d837a7365da6845da2f345a5a5b31d4bb3ecc704..b9e51bcb1623479bdaa6f296c816d5188c7270eb 100644 (file)
@@ -130,5 +130,5 @@ module.exports = Scale.extend({
        }
 });
 
-// INTERNAL: static default options, registered in src/chart.js
+// INTERNAL: static default options, registered in src/index.js
 module.exports._defaults = defaultConfig;
index 41a4e4168a36ee1dcdf839ca4ae050d5a29c8a01..a2199b66e78dbba87d950c3bb3e13ce4063ee409 100644 (file)
@@ -186,5 +186,5 @@ module.exports = LinearScaleBase.extend({
        }
 });
 
-// INTERNAL: static default options, registered in src/chart.js
+// INTERNAL: static default options, registered in src/index.js
 module.exports._defaults = defaultConfig;
index 06b206df27ce729e80270ff9a2a4b5531930c23d..fd67f0b19a45c8a58390d9b17a0c4af429f9bc9e 100644 (file)
@@ -345,5 +345,5 @@ module.exports = Scale.extend({
        }
 });
 
-// INTERNAL: static default options, registered in src/chart.js
+// INTERNAL: static default options, registered in src/index.js
 module.exports._defaults = defaultConfig;
index d19c03e99bccd4f627e1b248fe57a040bd673e3a..ce605bde4043b0e0b0925e5cb5f05ea24c03d497 100644 (file)
@@ -530,5 +530,5 @@ module.exports = LinearScaleBase.extend({
        }
 });
 
-// INTERNAL: static default options, registered in src/chart.js
+// INTERNAL: static default options, registered in src/index.js
 module.exports._defaults = defaultConfig;
index 7d1df171e0fa444f905ccebd9649fd333317de33..0db15bb7859c17ec74921bc306340fde8fae7424 100644 (file)
@@ -764,5 +764,5 @@ module.exports = Scale.extend({
        }
 });
 
-// INTERNAL: static default options, registered in src/chart.js
+// INTERNAL: static default options, registered in src/index.js
 module.exports._defaults = defaultConfig;