Skip to content

Commit

Permalink
remove terser & fix rollup type setting & fix rollup cli bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
citron03 committed Jun 7, 2024
1 parent ee55fab commit 2532720
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 165 deletions.
1 change: 0 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './src/index';
export * from './src/utils';
export * from './src/cli';
146 changes: 2 additions & 144 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "colors-helper-tools",
"version": "1.6.4",
"version": "1.6.5",
"description": "help use color style ✨",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": {
"cht": "dist/index.js"
"cht": "dist/cli.js"
},
"scripts": {
"build": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
Expand Down Expand Up @@ -33,8 +33,6 @@
"@babel/core": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"@babel/preset-typescript": "^7.22.5",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/jest": "^29.5.3",
"jest": "^29.6.2",
Expand Down
31 changes: 15 additions & 16 deletions rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import { defineConfig } from 'rollup';
import typescript from '@rollup/plugin-typescript';
import json from '@rollup/plugin-json';
import terser from '@rollup/plugin-terser';

export default defineConfig({
input: 'index.ts',
output: [
{
file: 'dist/index.js',
format: 'cjs',
minifyInternalExports: true,
},
{
file: 'dist/index.min.js',
format: 'iife',
name: 'version',
plugins: [terser()],
},
input: {
index: 'index.ts',
cli: 'src/cli.ts',
},
output: {
dir: 'dist',
format: 'cjs',
minifyInternalExports: true,
},
plugins: [
typescript({
declaration: true,
declarationDir: 'dist/types',
exclude: ['node_modules/**'],
}),
],
plugins: [typescript(), json()],
});

0 comments on commit 2532720

Please sign in to comment.