mirror of
https://github.com/LukeHagar/firecamp.git
synced 2025-12-09 20:37:45 +00:00
chore: tsup config setup for scripts and rest-executor
This commit is contained in:
@@ -5,7 +5,10 @@
|
||||
"private": true,
|
||||
"repository": "https://github.com/firecamp-io/firecamp/packages-executors/rest-executor",
|
||||
"keywords": [],
|
||||
"main": "dist/index.js",
|
||||
"main": "dist/index.cjs",
|
||||
"module": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsup src --target esnext --dts",
|
||||
"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';
|
||||
|
||||
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",
|
||||
"license": "",
|
||||
"keywords": [],
|
||||
"main": "dist/index.js",
|
||||
"main": "dist/index.cjs",
|
||||
"module": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build:old": "run-p 'build:*'",
|
||||
"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,
|
||||
type: 'asset/resource',
|
||||
},
|
||||
{
|
||||
test: /\.m?js/,
|
||||
resolve: {
|
||||
fullySpecified: false,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user