Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@tamagui/build
Advanced tools
A small, opinionated build script for libraries that target both React Native and React web.
A small, opinionated build script for libraries that target both React Native and React web.
It has a few features that make it useful for "universal" libraries:
./types
dist/esm
and dist/cjs
for ESModules and CommonJS.js
and .mjs
files in dist/esm
.mjs
, adds path-specific imports to non-specific importspkgRemoveSideEffects
).native.js
and regular .js
files for all output files, so React Native always loads separate files from web. In the native
specific files,
process.env.TAMAGUI_TARGET
is defined native
(otherwise web
)react-native
are transformed to react-native-web
It assumes your package.json looks something like this:
{
"source": "src/index.tsx",
"types": "./types/index.d.ts",
"main": "dist/cjs",
"module": "dist/esm",
"removeSideEffects": "true",
"scripts": {
"build": "tamagui-build",
"watch": "tamagui-build --watch",
"clean": "tamagui-build clean"
},
"exports": {
"./package.json": "./package.json",
".": {
"react-native-import": "./dist/esm/index.native.js",
"react-native": "./dist/cjs/index.native.js",
"types": "./types/index.d.ts",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.js"
}
},
"devDependencies": {
"@tamagui/build": "latest"
},
"tamagui": {
"build": {
"skipEnvToMeta": true,
"bundle.native": "./src/index.ts",
"bundle.native.test": "./src/index.ts"
}
},
}
npx @tamagui/build
or install and use the CLI:
tamagui-build
- builds src
folder to dist
and types
folders
tamagui build .
second argument sets baseUrl to tsc--bundle-modules
- inline node_modules--declaration-root
- sets tsc flag --declarationDir ./
--ignore-base-url
- if not set, tsc is passed --baseUrl .
--skip-mjs
- don't output mjs filestamagui-build --watch
- watches for changes and does the abovetamagui-build clean
- cleans dist, types, node_modules foldersFAQs
A small, opinionated build script for libraries that target both React Native and React web.
The npm package @tamagui/build receives a total of 31,630 weekly downloads. As such, @tamagui/build popularity was classified as popular.
We found that @tamagui/build demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.