mirror of
https://github.com/enso-org/enso.git
synced 2024-12-22 06:01:35 +03:00
5a100ea79b
* Switch dashboard to esbuild
* Minor fixes; move Tailwind generation into esbuild-config
* Fix watching `content/` and `client/`
* Bump esbuild binary versions; minor dependency list fixes
* Fixes; rename "npm run dev" to "npm run watch-dashboard"
* Avoid writing esbuild outputs to disk for `dashboard/`
* Convert watch-dashboard to be fully in-memory; rebuild css files on change
* Remove obsolete FIXME
* Remove unused constants
* Run prettier
* add missing styles
* Fixes
* Fix the fixes
* Run prettier
* Fixes; use nesting plugin to wrap tailwind preflight
* Remove testing flag from client/watch
* Minor fixes
* Run prettier
* Make css rebuild when tailwind config changes
* Fix bundling for dashboard
* Fix dashboard/bundle.ts erroring when build directory does not exist
* Fix esbuild binary package names
* Remove redundant "npx" prefix from build scripts
* Remove unused dependency
* workaround for mac freeze
* add missing sections
* Address review issue
* Fix live-reload of `npm run watch-dashboard`
* Fix service worker for client-side routing
* Fix GL crash
* Revert "Fix GL crash"
This reverts commit 612136bc1a
.
* Implement suggested fix
* prettier
---------
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
57 lines
1.9 KiB
TypeScript
57 lines
1.9 KiB
TypeScript
/** @file Esbuild config file. */
|
|
import * as path from 'node:path'
|
|
|
|
import * as esbuild from 'esbuild'
|
|
|
|
import * as paths from './paths'
|
|
|
|
// ================
|
|
// === Bundling ===
|
|
// ================
|
|
|
|
/**
|
|
* Get the bundler options using the environment.
|
|
*
|
|
* The following environment variables are required:
|
|
* - `ENSO_BUILD_IDE` - output directory for bundled client files;
|
|
* - `ENSO_BUILD_PROJECT_MANAGER_IN_BUNDLE_PATH` - path to the project manager executable relative to the PM bundle root;
|
|
* - `ENSO_BUILD_IDE_BUNDLED_ENGINE_VERSION` - version of the Engine (backend) that is bundled along with this client build.
|
|
*
|
|
* @see bundlerOptions
|
|
*/
|
|
export function bundlerOptionsFromEnv(): esbuild.BuildOptions {
|
|
return bundlerOptions(
|
|
path.join(paths.getIdeDirectory(), 'client'),
|
|
paths.getProjectManagerInBundlePath(),
|
|
paths.getBundledEngineVersion()
|
|
)
|
|
}
|
|
|
|
/** Get options without relying on the environment. */
|
|
export function bundlerOptions(
|
|
outdir: string,
|
|
projectManagerInBundlePath: string,
|
|
bundledEngineVersion: string
|
|
): esbuild.BuildOptions {
|
|
return {
|
|
bundle: true,
|
|
outdir,
|
|
entryPoints: ['src/index.ts', 'src/preload.ts'],
|
|
outbase: 'src',
|
|
format: 'cjs',
|
|
// Disabling naming convnetion lints below
|
|
// because they are third-party configuration options.
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
outExtension: { '.js': '.cjs' },
|
|
platform: 'node',
|
|
define: {
|
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
BUNDLED_ENGINE_VERSION: JSON.stringify(bundledEngineVersion),
|
|
PROJECT_MANAGER_IN_BUNDLE_PATH: JSON.stringify(projectManagerInBundlePath),
|
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
},
|
|
sourcemap: true,
|
|
external: ['electron'],
|
|
}
|
|
}
|