Skip to content

Commit 6d6ba54

Browse files
committed
make watchified bundle step output plotly.js in build/:
- so that temporary dev build are ignored by git. - `npm run build` is reserved for dist/ builds, while `npm run watch` and `npm run start-test_dashboard` use the build/ plotly.js
1 parent c14040b commit 6d6ba54

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@ node_modules
33
build/*
44
!build/README.md
55

6-
dist/*
7-
!dist/README.md
8-
96
npm-debug.log

devtools/test_dashboard/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
<script type="text/javascript" src="../../dist/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
1313

14-
<script type="text/javascript" src="../../dist/plotly.js" charset="utf-8"></script>
14+
<!-- use dev plotly.js build -->
15+
<script type="text/javascript" src="../../build/plotly.js" charset="utf-8"></script>
1516

1617
<!-- use local topojson files -->
1718
<script>Plotly.setPlotConfig({ topojsonURL: '../../dist/topojson/' });</script>

tasks/bundle.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ var constants = require('./util/constants');
1313
* Run `npm run build -- dev` or `npm run build -- --dev`
1414
* to include source map in the plotly.js bundle
1515
*
16+
* N.B. This script is meant for dist builds; the output bundles are placed
17+
* in plotly.js/dist/.
18+
* Use `npm run watch` for dev builds.
1619
*/
1720

1821
var arg = process.argv[2];

tasks/util/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = {
1111
pathToMocks: path.join(pathToRoot, 'test/image/mocks'),
1212

1313
pathToPlotlySrc: path.join(pathToSrc, 'index.js'),
14+
pathToPlotlyBuild: path.join(pathToBuild, 'plotly.js'),
1415
pathToPlotlyDist: path.join(pathToDist, 'plotly.js'),
1516
pathToPlotlyDistMin: path.join(pathToDist, 'plotly.min.js'),
1617
pathToPlotlyDistWithMeta: path.join(pathToDist, 'plotly-with-meta.js'),

tasks/util/make_watchified_bundle.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ var constants = require('./constants');
1111
/**
1212
* Make a plotly.js browserify bundle function watched by watchify.
1313
*
14+
* N.B. This module is meant for dev builds; the output bundle is placed
15+
* in plotly.js/build/
16+
* Use `npm run build` for dist builds.
17+
*
1418
* @param {function} onFirstBundleCallback executed when first bundle is completed
1519
*
1620
*/
@@ -47,10 +51,10 @@ module.exports = function makeWatchifiedBundle(onFirstBundleCallback) {
4751
}
4852
})
4953
.pipe(
50-
fs.createWriteStream(constants.pathToPlotlyDist)
54+
fs.createWriteStream(constants.pathToPlotlyBuild)
5155
)
5256
.on('finish', function() {
53-
appendVersion(constants.pathToPlotlyDist, {object: 'Plotly', DEV: true});
57+
appendVersion(constants.pathToPlotlyBuild, {object: 'Plotly', DEV: true});
5458
});
5559
}
5660

0 commit comments

Comments
 (0)