Skip to content

Avoid unexpected character in partial bundles #5835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
"custom-bundle": "node tasks/custom_bundle.js",
"bundle": "node tasks/bundle.js",
"extra-bundles": "node tasks/extra_bundles.js",
"locales": "node tasks/locales.js",
"schema": "node tasks/schema.js",
"stats": "node tasks/stats.js",
"find-strings": "node tasks/find_locale_strings.js",
"preprocess": "node tasks/preprocess.js",
"use-draftlogs": "node tasks/use_draftlogs.js",
"empty-draftlogs": "node tasks/empty_draftlogs.js",
"empty-dist": "node tasks/empty_dist.js",
"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",
"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",
"cibuild": "npm run empty-dist && npm run preprocess && node tasks/cibundle.js",
"watch": "node tasks/watch.js",
"lint": "eslint --version && eslint .",
Expand Down
15 changes: 0 additions & 15 deletions tasks/bundle.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
var path = require('path');
var glob = require('glob');
var runSeries = require('run-series');
var prependFile = require('prepend-file');

var constants = require('./util/constants');
var common = require('./util/common');
var _bundle = require('./util/browserify_wrapper');
var wrapLocale = require('./util/wrap_locale');

var header = constants.licenseDist + '\n';
var pathToLib = constants.pathToLib;
var pathToDist = constants.pathToDist;
var pathToPlotlyDist = constants.pathToPlotlyDist;
var pathToPlotlyIndex = constants.pathToPlotlyIndex;
var pathToPlotlyDistMin = constants.pathToPlotlyDistMin;
Expand All @@ -27,16 +22,6 @@ if(!doesFileExist(constants.pathToCSSBuild)) {
].join('\n'));
}

// "Browserify" the locales
var localeGlob = path.join(pathToLib, 'locales', '*.js');
glob(localeGlob, function(err, files) {
files.forEach(function(file) {
var outName = 'plotly-locale-' + path.basename(file);
var outPath = path.join(pathToDist, outName);
wrapLocale(file, outPath);
});
});

// list of tasks to pass to run-series to not blow up
// memory consumption.
var tasks = [];
Expand Down
18 changes: 18 additions & 0 deletions tasks/locales.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var path = require('path');
var glob = require('glob');

var constants = require('./util/constants');
var wrapLocale = require('./util/wrap_locale');

var pathToLib = constants.pathToLib;
var pathToDist = constants.pathToDist;

// "Browserify" the locales
var localeGlob = path.join(pathToLib, 'locales', '*.js');
glob(localeGlob, function(err, files) {
files.forEach(function(file) {
var outName = 'plotly-locale-' + path.basename(file);
var outPath = path.join(pathToDist, outName);
wrapLocale(file, outPath);
});
});