@tamagui/build 1.0.1-beta.141 → 1.0.1-beta.142

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tamagui-build.js +8 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/build",
3
- "version": "1.0.1-beta.141",
3
+ "version": "1.0.1-beta.142",
4
4
  "bin": {
5
5
  "tamagui-build": "tamagui-build.js"
6
6
  },
package/tamagui-build.js CHANGED
@@ -7,11 +7,12 @@ const esbuild = require('esbuild')
7
7
  const fg = require('fast-glob')
8
8
  const createExternalPlugin = require('./externalNodePlugin')
9
9
  const debounce = require('lodash.debounce')
10
- const { dirname, join } = require('path')
10
+ const { dirname } = require('path')
11
11
 
12
12
  const jsOnly = !!process.env.JS_ONLY
13
13
  const skipJS = !!(process.env.SKIP_JS || false)
14
- const shouldSkipTypes = !!(process.argv.includes('skip-types') || process.env.SKIP_TYPES)
14
+ const shouldSkipTypes = !!(process.argv.includes('--skip-types') || process.env.SKIP_TYPES)
15
+ const shouldBundle = !!process.argv.includes('--bundle')
15
16
  const shouldClean = !!process.argv.includes('clean')
16
17
  const shouldCleanBuildOnly = !!process.argv.includes('clean:build')
17
18
  const shouldWatch = process.argv.includes('--watch')
@@ -145,7 +146,7 @@ async function buildJs() {
145
146
  if (skipJS) {
146
147
  return
147
148
  }
148
- let files = (await fg(['src/**/*.(m)?ts(x)?', 'src/**/*.css'])).filter(
149
+ let files = (await fg(['src/**/*.(m)?[jt]s(x)?', 'src/**/*.css'])).filter(
149
150
  (x) => !x.includes('.d.ts')
150
151
  )
151
152
  const externalPlugin = createExternalPlugin({
@@ -157,7 +158,7 @@ async function buildJs() {
157
158
  ? esbuildWriteIfChanged({
158
159
  entryPoints: files,
159
160
  outdir: flatOut ? 'dist' : 'dist/cjs',
160
- bundle: false,
161
+ bundle: shouldBundle,
161
162
  sourcemap: true,
162
163
  target: 'node14',
163
164
  keepNames: false,
@@ -169,11 +170,11 @@ async function buildJs() {
169
170
  platform: 'node',
170
171
  })
171
172
  : null,
172
- // dont bundle for tree shaking
173
173
  pkgModule
174
174
  ? esbuildWriteIfChanged({
175
175
  entryPoints: files,
176
176
  outdir: flatOut ? 'dist' : 'dist/esm',
177
+ bundle: shouldBundle,
177
178
  sourcemap: true,
178
179
  target: 'node16',
179
180
  keepNames: false,
@@ -181,7 +182,7 @@ async function buildJs() {
181
182
  color: true,
182
183
  logLevel: 'error',
183
184
  minify: false,
184
- platform: 'neutral',
185
+ platform: shouldBundle ? 'node' : 'neutral',
185
186
  })
186
187
  : null,
187
188
  pkgModuleJSX
@@ -190,6 +191,7 @@ async function buildJs() {
190
191
  jsx: 'preserve',
191
192
  outdir: flatOut ? 'dist' : 'dist/jsx',
192
193
  entryPoints: files,
194
+ bundle: shouldBundle,
193
195
  sourcemap: true,
194
196
  target: 'es2020',
195
197
  keepNames: false,