-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: unify ESM/UMD build and development with Vite (#522)
* feat: try esbuild build * chore: separate build scripts * chore: try umd with esbuild * feat: working umd bundle * test: fix tests & format * chore: format tsconfig.json * chore: comment on build script * chore: include sourcemaps * chore: remove script tags for webpack & import higlass css * chore: minify UMD bundle * chore: update editor styles to remove bootstrap dependency (#505) * chore: update css to remove bootstrap dependency * chore: adjust title bar css * chore: rest of css adjustments * fix: simplify polyfills * fix: remove nullish collascing * feat: replace webpack/webpack-dev-server with vite * chore: update package.json * fix: format html * chore: update bundle-worker comment * chore: remove webpack.config.js * feat: add react-refresh plugin * test: bump minimum node to 12 * fix: support monaco functions (#511) * fix: tsc compilation * fix: silence error message on chromSizesUrl * fix: restore monaco behavior without all languages * fix: use lodash-es * test: isolate cross-fetch import to test * chore: update d3 types * fix: restore monaco setup * feat: unified vite * feat: build library target * chore: upgrade vite * chore: remove unneeded aliases * chore: minimally polyfill node built-ins * chore: move aliases to vite.config.js * feat: unify build with vite * feat: break out umd build * chore: bundle some dependencies * chore: reinstall with yarn-lock * fix: jest loader for inline worker * chore: update url in CONTRIBUTING.md * fix: zlib/vm polyfills * fix: emit ts types * refactor: use define to inject global * chore: remove jsoncrush from .eslintignore * chore: wrap JSONCrush with encodeURIComponent to reflect on the recent library update Co-authored-by: Sehi L'Yi <[email protected]> Co-authored-by: Sehi L'Yi <[email protected]>
- Loading branch information
1 parent
ef0fd59
commit ac7722c
Showing
81 changed files
with
7,309 additions
and
17,778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,4 @@ module.exports = { | |
'no-useless-concat': 'error', | ||
"prefer-template": 'error' | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const esbuild = require('esbuild'); | ||
const pkg = require('./package.json'); | ||
|
||
esbuild.build({ | ||
entryPoints: ['./dist/gosling.es.js'], | ||
target: 'esnext', | ||
outfile: pkg.main, | ||
bundle: true, | ||
format: 'cjs', | ||
minify: false, | ||
sourcemap: true, | ||
inject: ['./src/alias/buffer-shim.js'], | ||
external: ['react', 'react-dom', 'pixi.js', 'higlass'], | ||
define: { | ||
'process.platform': 'undefined', | ||
'process.env.THREADS_WORKER_INIT_TIMEOUT': 'undefined', | ||
'global': 'globalThis', | ||
}, | ||
// esbuild doesn't support UMD format directy. The banner/footer | ||
// wraps the commonjs output as a UMD module. The function signature is copied | ||
// from what is generated from rollup. If the external UMD dependencies change | ||
// (or the name of the gosling global) this needs changing. | ||
banner: { | ||
js: `\ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('pixi.js'), require('react'), require('higlass'), require('react-dom')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'pixi.js', 'react', 'higlass', 'react-dom'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.gosling = {}, global.PIXI, global.React, global.hglib, global.ReactDOM)); | ||
}(this, (function (exports, pixi_js, React, higlass, ReactDOM) { 'use strict'; | ||
var __mods = { 'pixi.js': pixi_js, 'react': React, 'react-dom': ReactDOM, 'higlass': higlass }; | ||
var require = name => __mods[name]; | ||
`, | ||
}, | ||
footer: { js: '\n})));' }, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/editor/example/basic-semantic-zoom.ts → editor/example/basic-semantic-zoom.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.