File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 11import { Sequence } from './sequence' ;
22import { createDocument } from './document' ;
33import { TaskManager } from './task-manager' ;
4- import { Context , ComposeOption } from './types' ;
4+ import { Context , ComposeOption , MinifyResult } from './types' ;
55
66const DEFAULT_COMPOSE_OPTIONS : ComposeOption = {
77 minifyIds : true ,
@@ -77,7 +77,7 @@ export class EmailMinifier {
7777 } ;
7878 }
7979
80- async minify ( options ?: ComposeOption ) {
80+ async minify ( options ?: ComposeOption ) : Promise < MinifyResult > {
8181 const context = await this . createContext ( ) ;
8282 const taskManager = this . compose ( context , options ) ;
8383 const { originalEmailBody, document } = context ;
Original file line number Diff line number Diff line change @@ -57,3 +57,9 @@ export type TaskType =
5757 | 'minify-dataset-attrs'
5858 | 'remove-unused-attrs'
5959 | 'minify-styles' ;
60+
61+ export type MinifyResult = {
62+ original : string ;
63+ minified : string | null ;
64+ tasks : Task [ ] ;
65+ } ;
Original file line number Diff line number Diff line change 11{
22 "name" : " email-minifier" ,
3- "version" : " 0.1 .0" ,
3+ "version" : " 1.0 .0" ,
44 "keywords" : [
55 " compress" ,
66 " compressor" ,
3636 "scripts" : {
3737 "lint" : " npx eslint . --fix" ,
3838 "build" : " npm run lint && rm -rf dist && rollup --config --bundleConfigAsCjs" ,
39- "test" : " npm run lint && jest"
39+ "test" : " npm run lint && jest" ,
40+ "publish" : " npm run build && npm publish"
4041 },
4142 "repository" : {
4243 "type" : " git" ,
You can’t perform that action at this time.
0 commit comments