Attributes
Popular
Includes Deno configuration
Repository
Current version released
2 years ago
Dependencies
deno.land/x
esm.sh
std
Versions
- v1.3.10Latest
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-beta.3
- v1.0.0-beta.2
- v1.0.0-beta.1
- v1.0.0-alpha.47
- v1.0.0-alpha.46
- v1.0.0-alpha.45
- v1.0.0-alpha.44
- v1.0.0-alpha.43
- v1.0.0-alpha.42
- v1.0.0-alpha.41
- v1.0.0-alpha.40
- v1.0.0-alpha.39
- v1.0.0-alpha.38
- v1.0.0-alpha.37
- v1.0.0-alpha.36
- v1.0.0-alpha.35
- v1.0.0-alpha.34
- v1.0.0-alpha.33
- v1.0.0-alpha.32
- v1.0.0-alpha.31
- v1.0.0-alpha.30
- v1.0.0-alpha.29
- v1.0.0-alpha.28
- v1.0.0-alpha.27
- v1.0.0-alpha.26
- v1.0.0-alpha.25
- v1.0.0-alpha.24
- v1.0.0-alpha.23
- v1.0.0-alpha.22
- v1.0.0-alpha.21
- v1.0.0-alpha.20
- v1.0.0-alpha.19
- v1.0.0-alpha.18
- v1.0.0-alpha.17
- v1.0.0-alpha.16
- v1.0.0-alpha.15
- v1.0.0-alpha.14
- v1.0.0-alpha.13
- v1.0.0-alpha.12
- v1.0.0-alpha.11
- v1.0.0-alpha.10
- v1.0.0-alpha.9
- v1.0.0-alpha.8
- v1.0.0-alpha.7
- v1.0.0-alpha.6
- v1.0.0-alpha.5
- v1.0.0-alpha.4
- v1.0.0-alpha.3
- v1.0.0-alpha.2
- v1.0.0-alpha.1
🌄 mesozoic
A generic build system for Deno web apps.
What does it do?
Mesozoic takes your source files from root
, copies those source files to
output
(preserving your project directory structure), transforms your
JavaScript/TypeScript with swc, transforms your stylesheets
with Lightning CSS and writes those resulting
transformations to your output
directory.
API
You can build your own bespoke build system on top of Mesozoic, which Ultra.js is currently doing.
import { Builder } from "https://deno.land/x/mesozoic@v1.0.0-alpha.46/mod.ts";
const builder = new Builder({
root: "/absolute/path/to/source",
output: "/absolute/path/to/output",
importMapPath: "./importMap.json",
compiler: {
minify: true,
sourceMaps: false,
jsxImportSource: "react",
},
name: "mesozoic",
logLevel: "INFO",
});
/**
* Setup your entrypoints, relative to "root".
* A module graph will be built for each entry point defined.
* Remote dependencies will also be independently fetched and output,
* into each entry points "vendorOutputDir" at ./vendor
*/
builder.setEntrypoints({
"./client.tsx": {
vendorOutputDir: "browser",
target: "browser",
},
"./server.tsx": {
vendorOutputDir: "server",
target: "deno",
},
});
/**
* Ignore files from the build, relative to "root".
* Any file that matches the provided patterns won't be copied to the build output directory.
*/
builder.setIgnored([
"./README.md",
]);
/**
* Files which should have their contents hashed and added to the filename,
* great for long term caching (https://web.dev/use-long-term-caching/)
*/
builder.setHashed([
"./src/**/*.+(ts|tsx|js|jsx|css)",
"./public/**/*.+(css|ico|jpg|png|svg|gif|otf|ttf|woff)",
]);
/**
* Files which should be compiled by SWC, usually TypeScript or files with JSX.
*/
builder.setCompiled([
"./**/*.+(ts|tsx|js|jsx)",
]);
/**
* Clean the output directory
*/
await builder.cleanOutput();
/**
* Gather all source files from the root
*/
const sources = await builder.gatherSources();
/**
* Copy the files to the output directory
*/
const buildSources = await builder.copySources(sources);
/**
* Execute the build
*/
const result = await builder.build(buildSources);