Skip to content

Fix dashboard server #7180

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
Oct 1, 2024
Merged
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
31 changes: 29 additions & 2 deletions devtools/test_dashboard/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import open from 'open';
import minimist from 'minimist';

import constants from '../../tasks/util/constants.js';
import { context } from 'esbuild';
import { context, build } from 'esbuild';
import config from '../../esbuild-config.js';

import { glsl } from 'esbuild-plugin-glsl';

var args = minimist(process.argv.slice(2), {});
var PORT = args.port || 3000;
var strict = args.strict;
Expand All @@ -24,11 +26,36 @@ config.outfile = './build/plotly.js';
var mockFolder = constants.pathToTestImageMocks;

// mock list
getMockFiles()
await getMockFiles()
.then(readFiles)
.then(createMocksList)
.then(saveMockListToFile);

// Devtools config
var devtoolsConfig = {
entryPoints: [
path.join(constants.pathToRoot, 'devtools', 'test_dashboard', 'devtools.js')
],
outfile: path.join(constants.pathToRoot, 'build', 'test_dashboard-bundle.js'),
format: 'cjs',
globalName: 'Tabs',
bundle: true,
minify: false,
sourcemap: false,
plugins: [
glsl({
minify: true,
}),
],
define: {
global: 'window',
},
target: 'es2016',
logLevel: 'info',
};

build(devtoolsConfig);

var ctx = await context(config);
devServer();
console.log('watching esbuild...');
Expand Down