├── .editorconfig ├── .gitignore ├── .npmignore ├── .prettierrc.json ├── .travis.yml ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── declarations.d.ts ├── index.ts ├── jasmine.json ├── package-lock.json ├── package.json ├── test └── plugin.spec.ts └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 2 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /coverage 3 | /.nyc_output 4 | **/*.js 5 | **/*.map 6 | **/*.d.ts 7 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | **/* 2 | !**/*.js 3 | !**/*.map 4 | !**/*.d.ts 5 | !**/*.md 6 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "node" 4 | script: 5 | - npm test 6 | - npm run coveralls 7 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | ### [1.2.6](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.2.5...v1.2.6) (2021-03-09) 6 | 7 | 8 | ### Bug Fixes 9 | 10 | * add support for rollup 2.0.0 ([f305718](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/f30571856c744efc3a90cc2f5b0c97a122ea3043)), closes [#15](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/issues/15) 11 | * upate minify-html-literals to v1.3.5 ([ab89bb0](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/ab89bb00b2391b7c342f05cca73d640f68e7c7c5)) 12 | 13 | ### [1.2.5](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.2.4...v1.2.5) (2020-08-18) 14 | 15 | 16 | ### Bug Fixes 17 | 18 | * update minify-html-literals to v1.3.2 ([3408e5c](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/3408e5c8edd76452dc58745444e33e70ef1a93e3)) 19 | 20 | ### [1.2.4](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.2.3...v1.2.4) (2020-06-10) 21 | 22 | 23 | ### Bug Fixes 24 | 25 | * update minify-html-literals to v1.3.1 ([a1eb2ef](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/a1eb2ef26587c2abc521ffe66d16a6c22451043b)) 26 | 27 | ### [1.2.3](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.2.2...v1.2.3) (2020-02-08) 28 | 29 | ### Bug Fixes 30 | 31 | - update to minify-html-literals v1.3.0 ([56cfb8d](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/56cfb8d3dfc5d828a824cbeb92c3aab53bda379a)) 32 | 33 | 34 | 35 | ## [1.2.2](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.2.1...v1.2.2) (2019-02-13) 36 | 37 | ### Bug Fixes 38 | 39 | - failure to minify templates prefixed with comments ([ea8c98e](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/ea8c98e)) 40 | 41 | 42 | 43 | ## [1.2.1](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.2.0...v1.2.1) (2019-02-13) 44 | 45 | ### Bug Fixes 46 | 47 | - remove source files from package ([b784735](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/b784735)) 48 | 49 | 50 | 51 | # [1.2.0](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.1.2...v1.2.0) (2019-02-13) 52 | 53 | ### Bug Fixes 54 | 55 | - accept rollup 1 as peerDep ([#2](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/issues/2)) ([2867985](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/2867985)) 56 | 57 | ### Features 58 | 59 | - minify CSS tagged template literals ([6baf3c2](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/6baf3c2)) 60 | 61 | 62 | 63 | ## [1.1.2](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.1.1...v1.1.2) (2018-11-29) 64 | 65 | ### Bug Fixes 66 | 67 | - update minify-html-literals to 1.1.2 ([2a26e9c](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/2a26e9c)) 68 | 69 | 70 | 71 | ## [1.1.1](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.1.0...v1.1.1) (2018-10-25) 72 | 73 | ### Bug Fixes 74 | 75 | - update minify-html-literals to 1.1.1 ([6abe9bb](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/6abe9bb)) 76 | 77 | 78 | 79 | # [1.1.0](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.0.7...v1.1.0) (2018-10-24) 80 | 81 | ### Features 82 | 83 | - update minify-html-literals to 1.1.0 ([a1d9f1d](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/a1d9f1d)) 84 | 85 | 86 | 87 | ## [1.0.7](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.0.6...v1.0.7) (2018-10-05) 88 | 89 | ### Bug Fixes 90 | 91 | - do not remove tag whitespace ([7d4d289](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/7d4d289)) 92 | 93 | 94 | 95 | ## [1.0.6](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.0.5...v1.0.6) (2018-10-03) 96 | 97 | ### Bug Fixes 98 | 99 | - do not collapse boolean attributes for Polymer binding syntax ([8597d14](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/8597d14)) 100 | 101 | 102 | 103 | ## [1.0.5](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.0.4...v1.0.5) (2018-09-27) 104 | 105 | ### Bug Fixes 106 | 107 | - update parse-literals to minify escaped characters properly ([ff2df26](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/ff2df26)) 108 | 109 | 110 | 111 | ## [1.0.4](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.0.3...v1.0.4) (2018-09-19) 112 | 113 | ### Bug Fixes 114 | 115 | - update minify-html-literals to not sort attributes or classes ([dc66de0](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/dc66de0)) 116 | 117 | 118 | 119 | ## [1.0.3](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.0.2...v1.0.3) (2018-09-19) 120 | 121 | ### Bug Fixes 122 | 123 | - update minify-html-literals to use hires sourcemaps ([8dcb055](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/8dcb055)) 124 | 125 | 126 | 127 | ## [1.0.2](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.0.1...v1.0.2) (2018-09-13) 128 | 129 | ### Bug Fixes 130 | 131 | - do not require fileName in minify options ([9543ef1](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/9543ef1)) 132 | - update dependencies and typings ([0a43630](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/0a43630)) 133 | 134 | 135 | 136 | ## [1.0.1](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/compare/v1.0.0...v1.0.1) (2018-07-24) 137 | 138 | ### Bug Fixes 139 | 140 | - typescript build issues ([0d1b01f](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/0d1b01f)) 141 | 142 | 143 | 144 | # 1.0.0 (2018-07-23) 145 | 146 | ### Features 147 | 148 | - initial release ([e3f2d8c](https://github.com/asyncLiz/rollup-plugin-minify-html-literals/commit/e3f2d8c)) 149 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2018 Elizabeth Mitchell 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rollup-plugin-minify-html-literals 2 | 3 | [![npm](https://img.shields.io/npm/v/rollup-plugin-minify-html-literals.svg)](https://www.npmjs.com/package/rollup-plugin-minify-html-literals) 4 | [![Build Status](https://travis-ci.com/asyncLiz/rollup-plugin-minify-html-literals.svg?branch=master)](https://travis-ci.com/asyncLiz/rollup-plugin-minify-html-literals) 5 | [![Coverage Status](https://coveralls.io/repos/github/asyncLiz/rollup-plugin-minify-html-literals/badge.svg?branch=master)](https://coveralls.io/github/asyncLiz/rollup-plugin-minify-html-literals?branch=master) 6 | 7 | Uses [minify-html-literals](https://www.npmjs.com/package/minify-html-literals) to minify HTML and CSS markup inside JavaScript template literal strings. 8 | 9 | ## Usage 10 | 11 | ```js 12 | import babel from 'rollup-plugin-babel'; 13 | import minifyHTML from 'rollup-plugin-minify-html-literals'; 14 | import { uglify } from 'rollup-plugin-uglify'; 15 | 16 | export default { 17 | entry: 'index.js', 18 | dest: 'dist/index.js', 19 | plugins: [ 20 | minifyHTML(), 21 | // Order plugin before transpilers and other minifiers 22 | babel(), 23 | uglify() 24 | ] 25 | }; 26 | ``` 27 | 28 | By default, this will minify any tagged template literal string whose tag contains "html" or "css" (case insensitive). [Additional options](https://www.npmjs.com/package/minify-html-literals#options) may be specified to control what templates should be minified. 29 | 30 | ## Options 31 | 32 | ```js 33 | export default { 34 | entry: 'index.js', 35 | dest: 'dist/index.js', 36 | plugins: [ 37 | minifyHTML({ 38 | // minimatch of files to minify 39 | include: [], 40 | // minimatch of files not to minify 41 | exclude: [], 42 | // set to `true` to abort bundling on a minification error 43 | failOnError: false, 44 | // minify-html-literals options 45 | // https://www.npmjs.com/package/minify-html-literals#options 46 | options: null, 47 | 48 | // Advanced Options 49 | // Override minify-html-literals function 50 | minifyHTMLLiterals: null, 51 | // Override rollup-pluginutils filter from include/exclude 52 | filter: null 53 | }) 54 | ] 55 | }; 56 | ``` 57 | 58 | ## Examples 59 | 60 | ### Minify Polymer Templates 61 | 62 | ```js 63 | import minifyHTML from 'rollup-plugin-minify-html-literals'; 64 | import { defaultShouldMinify } from 'minify-html-literals'; 65 | 66 | export default { 67 | entry: 'index.js', 68 | dest: 'dist/index.js', 69 | plugins: [ 70 | minifyHTML({ 71 | options: { 72 | shouldMinify(template) { 73 | return ( 74 | defaultShouldMinify(template) || 75 | template.parts.some(part => { 76 | // Matches Polymer templates that are not tagged 77 | return ( 78 | part.text.includes(' boolean; 6 | } 7 | -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import * as minify from 'minify-html-literals'; 3 | import { 4 | Plugin, 5 | SourceDescription, 6 | TransformHook, 7 | PluginContext 8 | } from 'rollup'; 9 | import { createFilter } from 'rollup-pluginutils'; 10 | 11 | /** 12 | * Plugin options. 13 | */ 14 | export interface Options { 15 | /** 16 | * Pattern or array of patterns of files to minify. 17 | */ 18 | include?: string | string[]; 19 | /** 20 | * Pattern or array of patterns of files not to minify. 21 | */ 22 | exclude?: string | string[]; 23 | /** 24 | * Minify options, see 25 | * https://www.npmjs.com/package/minify-html-literals#options. 26 | */ 27 | options?: Partial; 28 | /** 29 | * If true, any errors while parsing or minifying will abort the bundle 30 | * process. Defaults to false, which will only show a warning. 31 | */ 32 | failOnError?: boolean; 33 | /** 34 | * Override minify-html-literals function. 35 | */ 36 | minifyHTMLLiterals?: typeof minify.minifyHTMLLiterals; 37 | /** 38 | * Override include/exclude filter. 39 | */ 40 | filter?: (id: string) => boolean; 41 | } 42 | 43 | export default function( 44 | options: Options = {} 45 | ): Plugin & { transform: TransformHook } { 46 | if (!options.minifyHTMLLiterals) { 47 | options.minifyHTMLLiterals = minify.minifyHTMLLiterals; 48 | } 49 | 50 | if (!options.filter) { 51 | options.filter = createFilter(options.include, options.exclude); 52 | } 53 | 54 | const minifyOptions = options.options || {}; 55 | 56 | return { 57 | name: 'minify-html-literals', 58 | transform(this: PluginContext, code: string, id: string) { 59 | if (options.filter!(id)) { 60 | try { 61 | return options.minifyHTMLLiterals!(code, { 62 | ...minifyOptions, 63 | fileName: id 64 | }); 65 | } catch (error) { 66 | // check if Error ese treat as string 67 | const message = 68 | error instanceof Error ? error.message : (error as string); 69 | 70 | if (options.failOnError) { 71 | this.error(message); 72 | } else { 73 | this.warn(message); 74 | } 75 | } 76 | } 77 | } 78 | }; 79 | } 80 | -------------------------------------------------------------------------------- /jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_files": ["**/*spec.ts"], 3 | "stopSpecOnExpectationFailure": false, 4 | "random": true 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rollup-plugin-minify-html-literals", 3 | "version": "1.2.6", 4 | "description": "Rollup plugin to minify HTML template literal strings", 5 | "main": "index.js", 6 | "types": "index.d.ts", 7 | "author": "Liz Mitchell ", 8 | "license": "MIT", 9 | "keywords": [ 10 | "rollup-plugin", 11 | "minify", 12 | "html", 13 | "literal", 14 | "literals", 15 | "template", 16 | "tagged", 17 | "lit-html" 18 | ], 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/asyncLiz/rollup-plugin-minify-html-literals.git" 22 | }, 23 | "scripts": { 24 | "clean": "rimraf \"src/**/*.{js*,d.ts}\" && rimraf \"index.{js*,d.ts}\" && rimraf \"{.nyc_output/,coverage/}\"", 25 | "prebuild": "npm run clean", 26 | "build": "tsc", 27 | "pretest": "npm run clean", 28 | "test": "nyc mocha -r ts-node/register -r source-map-support/register test/*.ts", 29 | "coveralls": "cat coverage/lcov.info | coveralls", 30 | "lint": "prettier --write \"*.{js,ts,json,md}\" \"{src,test}/**/*\"", 31 | "precommit": "lint-staged", 32 | "release": "standard-version", 33 | "prepublishOnly": "npm run build" 34 | }, 35 | "lint-staged": { 36 | "*.{js,ts,json,md}": [ 37 | "prettier --write", 38 | "git add" 39 | ] 40 | }, 41 | "nyc": { 42 | "extension": [ 43 | ".ts" 44 | ], 45 | "include": [ 46 | "index.ts" 47 | ], 48 | "exclude": [ 49 | "index.d.ts" 50 | ], 51 | "reporter": [ 52 | "html", 53 | "lcovonly", 54 | "text-summary" 55 | ], 56 | "all": true 57 | }, 58 | "dependencies": { 59 | "minify-html-literals": "^1.3.5", 60 | "rollup-pluginutils": "^2.8.2" 61 | }, 62 | "peerDependencies": { 63 | "rollup": "^0.65.2 || ^1.0.0 || ^2.0.0 || ^3.0.0" 64 | }, 65 | "devDependencies": { 66 | "@types/chai": "^4.1.4", 67 | "@types/mocha": "^5.2.5", 68 | "@types/node": "^14.14.32", 69 | "@types/sinon": "^5.0.1", 70 | "chai": "^4.1.2", 71 | "coveralls": "^3.0.2", 72 | "husky": "^0.14.3", 73 | "lint-staged": "^8.2.1", 74 | "mocha": "^7.2.0", 75 | "nyc": "^15.0.0", 76 | "prettier": "^1.13.7", 77 | "rimraf": "^2.6.2", 78 | "rollup": "^3.5.1", 79 | "sinon": "^6.1.4", 80 | "source-map-support": "^0.5.6", 81 | "standard-version": "^9.0.0", 82 | "ts-node": "^7.0.0", 83 | "typescript": "^4.2.3" 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /test/plugin.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai'; 2 | import * as minify from 'minify-html-literals'; 3 | import * as path from 'path'; 4 | import { TransformPluginContext } from 'rollup'; 5 | import { match, SinonSpy, spy } from 'sinon'; 6 | import minifyHTML, { Options } from '../index'; 7 | 8 | describe('minify-html-literals', () => { 9 | const fileName = path.resolve('test.js'); 10 | let context: { warn: SinonSpy; error: SinonSpy }; 11 | beforeEach(() => { 12 | context = { 13 | warn: spy(), 14 | error: spy() 15 | }; 16 | }); 17 | 18 | it('should return a plugin with a transform function', () => { 19 | const plugin = minifyHTML(); 20 | expect(plugin).to.be.an('object'); 21 | expect(plugin.name).to.be.a('string'); 22 | expect(plugin.transform).to.be.a('function'); 23 | }); 24 | 25 | it('should call minifyHTMLLiterals()', () => { 26 | const options: Options = {}; 27 | const plugin = minifyHTML(options); 28 | expect(options.minifyHTMLLiterals).to.be.a('function'); 29 | const minifySpy = spy(options, 'minifyHTMLLiterals'); 30 | plugin.transform.apply((context as unknown) as TransformPluginContext, [ 31 | 'return', 32 | fileName 33 | ]); 34 | expect(minifySpy.called).to.be.true; 35 | }); 36 | 37 | it('should pass id and options to minifyHTMLLiterals()', () => { 38 | const options: Options = { 39 | options: { 40 | minifyOptions: { 41 | minifyCSS: false 42 | } 43 | } 44 | }; 45 | 46 | const plugin = minifyHTML(options); 47 | const minifySpy = spy(options, 'minifyHTMLLiterals'); 48 | plugin.transform.apply((context as unknown) as TransformPluginContext, [ 49 | 'return', 50 | fileName 51 | ]); 52 | expect( 53 | minifySpy.calledWithMatch( 54 | match.string, 55 | match({ 56 | fileName, 57 | minifyOptions: { 58 | minifyCSS: false 59 | } 60 | }) 61 | ) 62 | ).to.be.true; 63 | }); 64 | 65 | it('should allow custom minifyHTMLLiterals', () => { 66 | const customMinify = spy((source: string, options: minify.Options) => { 67 | return minify.minifyHTMLLiterals(source, options); 68 | }); 69 | 70 | const plugin = minifyHTML({ 71 | minifyHTMLLiterals: customMinify 72 | }); 73 | 74 | plugin.transform.apply((context as unknown) as TransformPluginContext, [ 75 | 'return', 76 | fileName 77 | ]); 78 | expect(customMinify.called).to.be.true; 79 | }); 80 | 81 | it('should warn errors', () => { 82 | const plugin = minifyHTML({ 83 | minifyHTMLLiterals: () => { 84 | throw new Error('failed'); 85 | } 86 | }); 87 | 88 | plugin.transform.apply((context as unknown) as TransformPluginContext, [ 89 | 'return', 90 | fileName 91 | ]); 92 | expect(context.warn.calledWith('failed')).to.be.true; 93 | expect(context.error.called).to.be.false; 94 | }); 95 | 96 | it('should fail is failOnError is true', () => { 97 | const plugin = minifyHTML({ 98 | minifyHTMLLiterals: () => { 99 | throw new Error('failed'); 100 | }, 101 | failOnError: true 102 | }); 103 | 104 | plugin.transform.apply((context as unknown) as TransformPluginContext, [ 105 | 'return', 106 | fileName 107 | ]); 108 | expect(context.error.calledWith('failed')).to.be.true; 109 | expect(context.warn.called).to.be.false; 110 | }); 111 | 112 | it('should filter ids', () => { 113 | let options: Options = {}; 114 | minifyHTML(options); 115 | expect(options.filter).to.be.a('function'); 116 | expect(options.filter!(fileName)).to.be.true; 117 | options = { 118 | include: '*.ts' 119 | }; 120 | 121 | minifyHTML(options); 122 | expect(options.filter).to.be.a('function'); 123 | expect(options.filter!(fileName)).to.be.false; 124 | expect(options.filter!(path.resolve('test.ts'))).to.be.true; 125 | }); 126 | 127 | it('should allow custom filter', () => { 128 | const options = { 129 | filter: spy(() => false) 130 | }; 131 | 132 | const plugin = minifyHTML(options); 133 | plugin.transform.apply((context as unknown) as TransformPluginContext, [ 134 | 'return', 135 | fileName 136 | ]); 137 | expect(options.filter.calledWith(fileName)).to.be.true; 138 | }); 139 | }); 140 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "noUnusedLocals": true, 7 | "noUnusedParameters": true, 8 | "sourceMap": true, 9 | "strict": true, 10 | "target": "esnext" 11 | }, 12 | "include": ["index.ts", "declarations.d.ts"] 13 | } 14 | --------------------------------------------------------------------------------