-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
…-691-merge/6.2.0 Revert "Revert "Revert "Merge/6.2.0"""
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
// @ts-check | ||
|
||
const alias = require('esbuild-plugin-alias'); | ||
const path = require('path'); | ||
const pkg = require('../package.json'); | ||
|
||
const cwd = process.cwd(); | ||
|
||
const entryPoints = pkg.entries.map((entry) => path.resolve(cwd, entry)); | ||
|
||
module.exports = /** @satisfies {import('esbuild').BuildOptions} */ ({ | ||
alias: Object.fromEntries( | ||
Object.entries(pkg.browser).map(([key, value]) => [ | ||
key, | ||
path.resolve(cwd, `${value}.js`), | ||
]) | ||
), | ||
const isProduction = process.env.NODE_ENV === 'production'; | ||
|
||
module.exports = { | ||
bundle: true, | ||
chunkNames: 'chunks/[name]-[hash]', | ||
entryPoints, | ||
entryNames: '[name]', | ||
external: ['crypto', 'libxslt'], | ||
format: 'esm', | ||
minify: true, | ||
format: 'iife', | ||
minify: isProduction, | ||
outdir: path.resolve(cwd, './public/js/build'), | ||
sourcemap: true, | ||
splitting: true, | ||
plugins: [ | ||
alias( | ||
Object.fromEntries( | ||
Object.entries(pkg.browser).map(([key, value]) => [ | ||
key, | ||
path.resolve(cwd, `${value}.js`), | ||
]) | ||
) | ||
), | ||
], | ||
sourcemap: isProduction ? false : 'inline', | ||
target: ['chrome89', 'edge89', 'firefox90', 'safari13'], | ||
}); | ||
}; |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.