mirror of
https://github.com/LukeHagar/firecamp.git
synced 2025-12-10 04:19:54 +00:00
chore: tsup config setup for scripts and rest-executor
This commit is contained in:
@@ -5,7 +5,10 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"repository": "https://github.com/firecamp-io/firecamp/packages-executors/rest-executor",
|
"repository": "https://github.com/firecamp-io/firecamp/packages-executors/rest-executor",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.cjs",
|
||||||
|
"module": "dist/index.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup src --target esnext --dts",
|
"build": "tsup src --target esnext --dts",
|
||||||
"build-old": "run-p 'build:*'",
|
"build-old": "run-p 'build:*'",
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
export { TPreScript, TTestScript, preScript, testScript } from './scripts';
|
export { preScript, testScript } from './scripts';
|
||||||
|
export type { TPreScript, TTestScript } from './scripts';
|
||||||
export * from './snippets';
|
export * from './snippets';
|
||||||
|
|||||||
18
packages/firecamp-scripts/tsup.config.ts
Normal file
18
packages/firecamp-scripts/tsup.config.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import type { Options } from 'tsup';
|
||||||
|
|
||||||
|
const env = process.env.NODE_ENV;
|
||||||
|
|
||||||
|
export const tsup: Options = {
|
||||||
|
splitting: true,
|
||||||
|
clean: true, // clean up the dist folder
|
||||||
|
dts: true, // generate dts files
|
||||||
|
format: ['cjs', 'esm'], // generate cjs and esm files
|
||||||
|
minify: env === 'production',
|
||||||
|
bundle: env === 'production',
|
||||||
|
skipNodeModulesBundle: true,
|
||||||
|
entryPoints: ['src/index.ts'],
|
||||||
|
watch: env === 'development',
|
||||||
|
target: 'es2020',
|
||||||
|
outDir: 'dist',
|
||||||
|
entry: ['src/**/*.ts'], //include all files under src
|
||||||
|
};
|
||||||
@@ -5,7 +5,10 @@
|
|||||||
"repository": "https://github.com/firecamp-io/firecamp/packages-executors/rest-executor",
|
"repository": "https://github.com/firecamp-io/firecamp/packages-executors/rest-executor",
|
||||||
"license": "",
|
"license": "",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.cjs",
|
||||||
|
"module": "dist/index.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:old": "run-p 'build:*'",
|
"build:old": "run-p 'build:*'",
|
||||||
"build": "tsup src --target esnext --dts",
|
"build": "tsup src --target esnext --dts",
|
||||||
|
|||||||
18
playgrounds/firecamp-rest-executor/tsup.config.ts
Normal file
18
playgrounds/firecamp-rest-executor/tsup.config.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import type { Options } from 'tsup';
|
||||||
|
|
||||||
|
const env = process.env.NODE_ENV;
|
||||||
|
|
||||||
|
export const tsup: Options = {
|
||||||
|
splitting: true,
|
||||||
|
clean: true, // clean up the dist folder
|
||||||
|
dts: true, // generate dts files
|
||||||
|
format: ['cjs', 'esm'], // generate cjs and esm files
|
||||||
|
minify: env === 'production',
|
||||||
|
bundle: env === 'production',
|
||||||
|
skipNodeModulesBundle: true,
|
||||||
|
entryPoints: ['src/index.ts'],
|
||||||
|
watch: env === 'development',
|
||||||
|
target: 'es2020',
|
||||||
|
outDir: 'dist',
|
||||||
|
entry: ['src/**/*.ts'], //include all files under src
|
||||||
|
};
|
||||||
@@ -185,4 +185,10 @@ exports.rules = [
|
|||||||
test: /\.(png|svg|jpg|jpeg|gif)$/i,
|
test: /\.(png|svg|jpg|jpeg|gif)$/i,
|
||||||
type: 'asset/resource',
|
type: 'asset/resource',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
test: /\.m?js/,
|
||||||
|
resolve: {
|
||||||
|
fullySpecified: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user