Skip to content

Commit 9f5a096

Browse files
committed
edit alternative building and adjust browserify on top
1 parent 8dcb78b commit 9f5a096

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

BUILDING.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
1-
# Building plotly.js
1+
# Alternative ways to require or build plotly.js
2+
Depending on your needs, to bundle plotly.js into your application one of [the browserified distributed plotly.js packages](https://github.com/plotly/plotly.js/blob/master/dist/README.md) on npm could be used.
23

3-
The easiest way to bundle plotly.js into your application is to use one of the distributed plotly.js packages on npm. These distributed packages should just work with **any** build framework. That said, if you're looking to save a few bytes, read the section below corresponding to your building framework.
4+
## Browserify example
5+
6+
Given source file:
7+
```js
8+
// file: index.js
9+
var Plotly = require('plotly.js-dist-min');
10+
// ....
11+
```
12+
13+
then simply run
14+
15+
```sh
16+
browserify index.js > bundle.js
17+
```
18+
19+
20+
21+
The section below provide additional info in respect to alternative building frameworks.
422

523
## Webpack
624

@@ -21,24 +39,6 @@ A repo that demonstrates how to build plotly.js with Webpack can be found [here]
2139
...
2240
```
2341

24-
## Browserify
25-
26-
Given source file:
27-
28-
```js
29-
// file: index.js
30-
31-
var Plotly = require('plotly.js');
32-
33-
// ....
34-
```
35-
36-
then simply run,
37-
38-
```
39-
browserify index.js > bundle.js
40-
```
41-
4242
## Angular CLI
4343

4444
Since Angular uses webpack under the hood and doesn't allow easily to change it's webpack configuration, there is some work needed using a `custom-webpack` builder to get things going.

0 commit comments

Comments
 (0)