From: Simon Brunel Date: Sat, 13 May 2017 12:14:02 +0000 (+0200) Subject: Fix RequireJS doc to use UMD file instead (#4252) X-Git-Tag: v2.6.0~2^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4c00b58342c5f46c5c54ec3caddd518c45fdf9f;p=thirdparty%2FChart.js.git Fix RequireJS doc to use UMD file instead (#4252) --- diff --git a/docs/getting-started/integration.md b/docs/getting-started/integration.md index 523883ece..173448f58 100644 --- a/docs/getting-started/integration.md +++ b/docs/getting-started/integration.md @@ -5,30 +5,32 @@ Chart.js can be integrated with plain JavaScript or with different module loader ## ES6 Modules ```javascript -import Chart from 'chart.js' -var myChart = new Chart(ctx, {...}) +import Chart from 'chart.js'; +var myChart = new Chart(ctx, {...}); ``` ## Script Tag ```html - + ``` ## Common JS ```javascript -var Chart = require('chart.js') -var myChart = new Chart(ctx, {...}) +var Chart = require('chart.js'); +var myChart = new Chart(ctx, {...}); ``` ## Require JS ```javascript -require(['path/to/Chartjs/src/chartjs.js'], function(Chart){ - var myChart = new Chart(ctx, {...}) -}) -``` \ No newline at end of file +require(['path/to/chartjs/dist/Chart.js'], function(Chart){ + var myChart = new Chart(ctx, {...}); +}); +``` + +> **Important:** RequireJS [can **not** load CommonJS module as is](http://www.requirejs.org/docs/commonjs.html#intro), so be sure to require one of the built UMD files instead (i.e. `dist/Chart.js`, `dist/Chart.min.js`, etc.).