mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Master merge first attempt
This commit is contained in:
parent
1e819a2acf
commit
550c874c9b
419 changed files with 24252 additions and 3446 deletions
|
@ -97,38 +97,65 @@ const createESMBrowserBuild = async () => {
|
|||
// );
|
||||
// });
|
||||
|
||||
const rawConfig = {
|
||||
entryPoints: ["index.tsx"],
|
||||
const rawConfigCommon = {
|
||||
bundle: true,
|
||||
format: "esm",
|
||||
plugins: [sassPlugin()],
|
||||
assetNames: "[dir]/[name]-[hash]",
|
||||
loader: {
|
||||
".json": "copy",
|
||||
".woff2": "file",
|
||||
},
|
||||
packages: "external",
|
||||
// chunks are always external, so they are not bundled within and get build separately
|
||||
external: ["*.chunk"],
|
||||
};
|
||||
|
||||
const createESMRawBuild = async () => {
|
||||
// Development unminified build with source maps
|
||||
await build({
|
||||
...rawConfig,
|
||||
const rawConfigIndex = {
|
||||
...rawConfigCommon,
|
||||
entryPoints: ["index.tsx"],
|
||||
};
|
||||
|
||||
const rawConfigChunks = {
|
||||
...rawConfigCommon,
|
||||
// create a separate chunk for each
|
||||
entryPoints: ["**/*.chunk.ts"],
|
||||
};
|
||||
|
||||
function buildDev(chunkConfig) {
|
||||
const config = {
|
||||
...chunkConfig,
|
||||
sourcemap: true,
|
||||
outdir: "dist/dev",
|
||||
define: {
|
||||
"import.meta.env": JSON.stringify({ DEV: true }),
|
||||
},
|
||||
});
|
||||
outdir: "dist/dev",
|
||||
};
|
||||
|
||||
// production minified build without sourcemaps
|
||||
await build({
|
||||
...rawConfig,
|
||||
return build(config);
|
||||
}
|
||||
|
||||
function buildProd(chunkConfig) {
|
||||
const config = {
|
||||
...chunkConfig,
|
||||
minify: true,
|
||||
outdir: "dist/prod",
|
||||
define: {
|
||||
"import.meta.env": JSON.stringify({ PROD: true }),
|
||||
},
|
||||
});
|
||||
outdir: "dist/prod",
|
||||
};
|
||||
|
||||
return build(config);
|
||||
}
|
||||
|
||||
const createESMRawBuild = async () => {
|
||||
// development unminified build with source maps
|
||||
await buildDev(rawConfigIndex);
|
||||
await buildDev(rawConfigChunks);
|
||||
|
||||
// production minified buld without sourcemaps
|
||||
await buildProd(rawConfigIndex);
|
||||
await buildProd(rawConfigChunks);
|
||||
};
|
||||
|
||||
createESMRawBuild();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue