-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathesbuild-config.js
More file actions
62 lines (57 loc) · 1.75 KB
/
esbuild-config.js
File metadata and controls
62 lines (57 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const { environmentPlugin } = require('esbuild-plugin-environment');
const { glsl } = require('esbuild-plugin-glsl');
const InlineCSSPlugin = require('esbuild-plugin-inline-css');
const path = require('path');
const constants = require('./tasks/util/constants.js');
// Default config used when building library
const esbuildConfig = {
entryPoints: ['./lib/index.js'],
format: 'iife',
globalName: 'Plotly',
bundle: true,
minify: false,
sourcemap: false,
plugins: [InlineCSSPlugin(), glsl({ minify: true }), environmentPlugin({ NODE_DEBUG: false })],
alias: {
stream: 'stream-browserify'
},
define: {
global: 'window',
'define.amd': 'false'
},
target: 'es2016',
logLevel: 'info'
};
// Config used when building bundle to serve test dashboard
const 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'
};
// Config used when building plotly.js for local development
const localDevConfig = {
...esbuildConfig,
outfile: './build/plotly.js'
};
// Config used when building bundle to serve regl
const localDevReglCodegenConfig = {
...esbuildConfig,
entryPoints: [path.join(constants.pathToRoot, 'devtools/regl_codegen', 'devtools.js')],
outfile: './build/regl_codegen-bundle.js',
sourcemap: false,
minify: false
};
module.exports = {
devtoolsConfig,
esbuildConfig,
localDevConfig,
localDevReglCodegenConfig
};