mkbuild 1.0.0-alpha.1
Install from the command line:
Learn more about npm packages
$ npm install @flex-development/mkbuild@1.0.0-alpha.1
Install via package.json:
"@flex-development/mkbuild": "1.0.0-alpha.1"
About this version
An esbuild based file-to-file transformer and bundler.
fast and minimal builds with esbuild (integrates with the build api for plugin support - say toodles ππΎ to transform api hacks! π)
create bundleless distributions with file-to-file transpilation and static asset copying
create es modules + add file extensions to specifiers in modules and declaration files
generate declarations for .cjs
, .cts
, .js
, .jsx
, .mjs
, .mts
, .ts
,
and .tsx
files
resolve path aliases in .cjs
, .cts
, .d.cts
, .d.mts
, .d.ts
, .js
,
.jsx
, .mjs
, .mts
, .ts
, and .tsx
files
yarn add -D @flex-development/mkbuild esbuild typescript
To install from the GitHub Package Registry, setup a .npmrc
or .yarnrc.yml
file to authenticate with the registry.
A Personal Access Token with the read:packages
scope is required.
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
@flex-development:registry=https://npm.pkg.github.com/
npmRegistries:
//npm.pkg.github.com:
npmAlwaysAuth: true
npmAuthToken: ${GITHUB_TOKEN}
npmScopes:
flex-development:
npmRegistryServer: https://npm.pkg.github.com
See npm-install or Git - Protocols | Yarn for details on requesting a specific branch, commit, or tag.
npm i -D flex-development/mkbuild
yarn add -D @flex-development/mkbuild@flex-development/mkbuild esbuild typescript
mkbuild
Running the command above without a build configuration file will create a bundleless esm build with declarations.
Files within the src
directory will be transpiled or copied and output to
dist/**.{d.mts,mjs}
. Declaration files, dist/**.d.mts
, will be generated if
typescript
is installed. The original folder structure and extensions of
copied files will remain in tact.
Create build.config.{cjs,cts,js,json,mjs,mts,ts}
:
/**
* @file Build Config
* @module config/build
*/
import { defineBuildConfig } from '@flex-development/mkbuild'
export default defineBuildConfig({
// esbuild options; see https://esbuild.github.io/api/#build-api
esbuild: {
sourcemap: 'external',
sourcesContent: false,
treeShaking: true,
tsconfig: 'tsconfig.build.json'
}
})
See all configuration options here.
See omitted esbuild
options here. Note that most
omitted options are applied via the build config, or via build
entries.
See options common to build configs and entries here.
/**
* @file Build Config
* @module config/build
*/
import { defineBuildConfig } from '@flex-development/mkbuild'
import tsconfig from './tsconfig.build.json' assert { type: 'json' }
export default defineBuildConfig({
entries: [
{ dts: true, ignore: ['cli.ts'] }, // dist/**.{d.mts,mjs}
{ dts: true, ext: '.cjs', format: 'cjs', ignore: ['cli.ts'] }, // dist/**.{cjs,d.cts}
{ dts: 'only', ext: '.js', ignore: ['cli.ts'] }, // dist/**.d.ts
{ bundle: true, minify: true, source: 'src/cli.ts' } // dist/cli.mjs
],
esbuild: {
platform: 'node',
sourcemap: 'external',
sourcesContent: false,
target: [tsconfig.compilerOptions.target, 'node14'],
treeShaking: true,
tsconfig: 'tsconfig.build.json'
}
})
See all build entry options here.
Details
- mkbuild
-
flex-development
- over 2 years ago
- BSD-3-Clause
- 93 dependencies
Assets
- mkbuild-1.0.0-alpha.1.tgz
Download activity
- Total downloads 13
- Last 30 days 0
- Last week 0
- Today 0