Skip to content

Commit db5c563

Browse files
authored
Merge pull request #5835 from plotly/unexpected-char
Avoid unexpected character in partial bundles
2 parents 99e66ad + 17969ad commit db5c563

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
"custom-bundle": "node tasks/custom_bundle.js",
2525
"bundle": "node tasks/bundle.js",
2626
"extra-bundles": "node tasks/extra_bundles.js",
27+
"locales": "node tasks/locales.js",
2728
"schema": "node tasks/schema.js",
2829
"stats": "node tasks/stats.js",
2930
"find-strings": "node tasks/find_locale_strings.js",
3031
"preprocess": "node tasks/preprocess.js",
3132
"use-draftlogs": "node tasks/use_draftlogs.js",
3233
"empty-draftlogs": "node tasks/empty_draftlogs.js",
3334
"empty-dist": "node tasks/empty_dist.js",
34-
"build": "npm run empty-dist && npm run preprocess && npm run find-strings && npm run bundle && npm run extra-bundles && npm run schema dist && npm run stats",
35+
"build": "npm run empty-dist && npm run preprocess && npm run find-strings && npm run bundle && npm run extra-bundles basic && npm run extra-bundles cartesian && npm run extra-bundles geo && npm run extra-bundles gl2d && npm run extra-bundles gl3d && npm run extra-bundles mapbox && npm run extra-bundles finance && npm run extra-bundles strict && npm run locales && npm run schema dist && npm run stats",
3536
"cibuild": "npm run empty-dist && npm run preprocess && node tasks/cibundle.js",
3637
"watch": "node tasks/watch.js",
3738
"lint": "eslint --version && eslint .",

tasks/bundle.js

-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
var path = require('path');
2-
var glob = require('glob');
31
var runSeries = require('run-series');
42
var prependFile = require('prepend-file');
53

64
var constants = require('./util/constants');
75
var common = require('./util/common');
86
var _bundle = require('./util/browserify_wrapper');
9-
var wrapLocale = require('./util/wrap_locale');
107

118
var header = constants.licenseDist + '\n';
12-
var pathToLib = constants.pathToLib;
13-
var pathToDist = constants.pathToDist;
149
var pathToPlotlyDist = constants.pathToPlotlyDist;
1510
var pathToPlotlyIndex = constants.pathToPlotlyIndex;
1611
var pathToPlotlyDistMin = constants.pathToPlotlyDistMin;
@@ -27,16 +22,6 @@ if(!doesFileExist(constants.pathToCSSBuild)) {
2722
].join('\n'));
2823
}
2924

30-
// "Browserify" the locales
31-
var localeGlob = path.join(pathToLib, 'locales', '*.js');
32-
glob(localeGlob, function(err, files) {
33-
files.forEach(function(file) {
34-
var outName = 'plotly-locale-' + path.basename(file);
35-
var outPath = path.join(pathToDist, outName);
36-
wrapLocale(file, outPath);
37-
});
38-
});
39-
4025
// list of tasks to pass to run-series to not blow up
4126
// memory consumption.
4227
var tasks = [];

tasks/locales.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var path = require('path');
2+
var glob = require('glob');
3+
4+
var constants = require('./util/constants');
5+
var wrapLocale = require('./util/wrap_locale');
6+
7+
var pathToLib = constants.pathToLib;
8+
var pathToDist = constants.pathToDist;
9+
10+
// "Browserify" the locales
11+
var localeGlob = path.join(pathToLib, 'locales', '*.js');
12+
glob(localeGlob, function(err, files) {
13+
files.forEach(function(file) {
14+
var outName = 'plotly-locale-' + path.basename(file);
15+
var outPath = path.join(pathToDist, outName);
16+
wrapLocale(file, outPath);
17+
});
18+
});

0 commit comments

Comments
 (0)