Skip to content

Commit 46723a8

Browse files
committed
adjust custom bundle script - fast creation of both minified and unminified
1 parent d0dd957 commit 46723a8

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

CUSTOM_BUNDLE.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,20 @@ npm run custom-bundle -- --traces scatter,scattergl --strict
5555
```
5656

5757
Use the `out` option to change the bundle filename (default `custom`).
58-
The new bundle will be created in the `dist/` directory and named `plotly-<out>.min.js` or `plotly-<out>.js` if unminified.
58+
The new bundle will be created in the `dist/` directory and named `plotly-<out>.js` and `plotly-<out>.min.js` for minified.
5959
```sh
6060
npm run custom-bundle -- --out myBundleName
6161
```
6262

63-
Use the `unminified` option to disable compression.
64-
```sh
65-
npm run custom-bundle -- --unminified
66-
```
67-
6863
# Example illustrating use of different options together
69-
To create an unminified custom bundle named `myScatters` including `scatter`, `scattergl` and `scatter3d` traces without any transforms:
64+
To create a custom bundle named `myScatters` including `scatter`, `scattergl` and `scatter3d` traces without any transforms:
7065
```sh
7166
npm run custom-bundle -- \
72-
--unminified \
7367
--out myScatters \
7468
--traces scatter,scattergl,scatter3d \
7569
--transforms none
7670
```
7771
Or simply on one line:
7872
```sh
79-
npm run custom-bundle -- --unminified --out myScatters --traces scatter,scattergl,scatter3d --transforms none
73+
npm run custom-bundle -- --out myScatters --traces scatter,scattergl,scatter3d --transforms none
8074
```

tasks/custom_bundle.mjs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ if(process.argv.length > 2) {
5252
var args = minimist(process.argv.slice(2), {});
5353

5454
// parse arguments
55-
var unminified = inputBoolean(args.unminified, false);
5655
var out = args.out ? args.out : 'custom';
5756
var traces = inputArray(args.traces, allTraces);
5857
var transforms = inputArray(args.transforms, allTransforms);
@@ -67,13 +66,8 @@ if(process.argv.length > 2) {
6766
strict: strict,
6867
};
6968

70-
if(unminified) {
71-
opts.dist = path.join(constants.pathToDist, 'plotly-' + out + '.js');
72-
} else {
73-
opts.distMin = path.join(constants.pathToDist, 'plotly-' + out + '.min.js');
74-
}
75-
76-
console.log(opts);
69+
opts.dist = path.join(constants.pathToDist, 'plotly-' + out + '.js');
70+
opts.distMin = path.join(constants.pathToDist, 'plotly-' + out + '.min.js');
7771

7872
opts.calendars = true;
7973
opts.deleteIndex = true;

0 commit comments

Comments
 (0)