From c4c00b58342c5f46c5c54ec3caddd518c45fdf9f Mon Sep 17 00:00:00 2001 From: Simon Brunel Date: Sat, 13 May 2017 14:14:02 +0200 Subject: [PATCH] Fix RequireJS doc to use UMD file instead (#4252) --- docs/getting-started/integration.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) 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.). -- 2.47.3