separação de configuração interna
This commit is contained in:
parent
4b7fe02ead
commit
7ca0c11f6c
5 changed files with 33 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "p-comuns",
|
"name": "p-comuns",
|
||||||
"version": "0.263.0",
|
"version": "0.264.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./dist-back/index.js",
|
"main": "./dist-back/index.js",
|
||||||
"module": "./dist-front/index.mjs",
|
"module": "./dist-front/index.mjs",
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"biome": "pnpm exec biome check --write",
|
"biome": "pnpm exec biome check --write",
|
||||||
"check": "pnpm run biome && npx tsc --noEmit",
|
"check": "pnpm run biome && npx tsc --noEmit",
|
||||||
"build": "npm --no-git-tag-version version minor && pnpm run biome && tsup --config ./tsup/tsup.config.ts && pnpm run pacote",
|
"build": "npm --no-git-tag-version version minor && pnpm run biome && tsup --config ./tsup/tsup.config.interno.ts && pnpm run pacote",
|
||||||
"teste": "npx vitest run src/testes/TipagemRotas.test.ts",
|
"teste": "npx vitest run src/testes/TipagemRotas.test.ts",
|
||||||
"pacote": "npm pack && npm pack && mv $(npm pack --silent) pacote.tgz"
|
"pacote": "npm pack && npm pack && mv $(npm pack --silent) pacote.tgz"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
BIN
pacote.tgz
BIN
pacote.tgz
Binary file not shown.
24
tsup/tsup.config.front.interno.ts
Normal file
24
tsup/tsup.config.front.interno.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
// tsup.config.ts (Configuração Ajustada para Back-end)
|
||||||
|
import { defineConfig, type Options } from "tsup"
|
||||||
|
|
||||||
|
// Definimos as opções em uma constante para clareza, como você fez.
|
||||||
|
// Exportamos para que possam ser reutilizadas ou inspecionadas.
|
||||||
|
export const tsup_config_front: Options = {
|
||||||
|
entry: ["src/index.ts"], // Adicionado .tsx para compatibilidade, se aplicável
|
||||||
|
format: "esm", // Gera módulos ES para import/export no navegador
|
||||||
|
target: "es2022", // Ou 'esnext' para os recursos mais recentes
|
||||||
|
outDir: "dist-front", // Diretório de saída para os arquivos transpilados
|
||||||
|
clean: true, // Limpa o diretório de saída antes de cada build
|
||||||
|
bundle: true, // ESSENCIAL: Mantém a estrutura de arquivos e pastas original
|
||||||
|
splitting: false, // Desnecessário quando bundle é false
|
||||||
|
dts: true, // Gera arquivos de declaração TypeScript (.d.ts) para uso em front-end JS
|
||||||
|
// legacyOutput e outExtension foram removidos por não serem necessários
|
||||||
|
sourcemap: false,
|
||||||
|
minify: true, // Recomendado para builds de produção
|
||||||
|
platform: "browser",
|
||||||
|
outExtension: () => ({ js: ".mjs" }),
|
||||||
|
noExternal: [/./]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exporta a configuração padrão usando defineConfig
|
||||||
|
export default defineConfig(tsup_config_front)
|
||||||
|
|
@ -17,7 +17,6 @@ export const tsup_config_front: Options = {
|
||||||
minify: true, // Recomendado para builds de produção
|
minify: true, // Recomendado para builds de produção
|
||||||
platform: "browser",
|
platform: "browser",
|
||||||
outExtension: () => ({ js: ".mjs" }),
|
outExtension: () => ({ js: ".mjs" }),
|
||||||
noExternal: [/./]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exporta a configuração padrão usando defineConfig
|
// Exporta a configuração padrão usando defineConfig
|
||||||
|
|
|
||||||
7
tsup/tsup.config.interno.ts
Normal file
7
tsup/tsup.config.interno.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
// tsup.config.ts (Configuração Ajustada para Back-end)
|
||||||
|
import { defineConfig } from "tsup"
|
||||||
|
import { tsup_config_back } from "./tsup.config.back"
|
||||||
|
import { tsup_config_front } from "./tsup.config.front.interno"
|
||||||
|
|
||||||
|
// Exporta a configuração padrão usando defineConfig
|
||||||
|
export default defineConfig([tsup_config_back, tsup_config_front])
|
||||||
Loading…
Add table
Add a link
Reference in a new issue