Skip to content

Commit

Permalink
build: browser runtime w/o minification
Browse files Browse the repository at this point in the history
  • Loading branch information
ogonkov committed Oct 9, 2024
1 parent e6ff7f0 commit 9988134
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
21 changes: 17 additions & 4 deletions esbuild/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,28 @@ const commonPlugin = {
},
};

esbuild.build({
...common,
const commonRuntime = {
entryPoints: ['src/runtime/index.ts'],
outfile: 'build/runtime/index.js',
minify: true,
loader: {
'.svg': 'text',
},
plugins: [inlineScss()],
};

esbuild.build({
...common,
...commonRuntime,
outfile: 'build/runtime/index-node.js',
platform: 'node',
minify: true,
});

esbuild.build({
...common,
...commonRuntime,
external: ['@gravity-ui/icons', 'd3', 'mermaid', 'ts-dedent'],
outfile: 'build/runtime/index.js',
platform: 'neutral',
});

esbuild.build({
Expand Down
4 changes: 1 addition & 3 deletions src/runtime/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type {ExposedAPI, InitConfig} from '../types';
import type {MermaidConfig} from 'mermaid';

// eslint-disable-next-line no-duplicate-imports
import mermaid from 'mermaid';
import mermaid, {MermaidConfig} from 'mermaid';
import dedent from 'ts-dedent';

import {bindZoomOptions, zoomBehavior} from './zoom';
Expand Down

0 comments on commit 9988134

Please sign in to comment.