diff --git a/package.json b/package.json index 0215231..870b5f3 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "@demouth/mb_strwidth", - "version": "1.0.0", + "version": "1.1.0", "main": "dist/index.js", "module": "dist/index.es.js", "browser": "dist/mb_strwidth.js", + "types": "dist/index.d.ts", "repository": "git@github.com:demouth/mb_strwidth.git", "author": "demouth ", "license": "MIT", diff --git a/rollup.config.js b/rollup.config.js index ad13de1..dbc676f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -42,7 +42,9 @@ export default [ } ], plugins: [ - pluginTypescript(), + pluginTypescript({ + tsconfig: './tsconfig.json' + }), pluginCommonjs({ extensions: ['.js', '.ts'], }), @@ -73,7 +75,9 @@ export default [ ...Object.keys(pkg.devDependencies || {}), ], plugins: [ - pluginTypescript(), + pluginTypescript({ + tsconfig: './tsconfig.json' + }), pluginCommonjs({ extensions: ['.js', '.ts'], }), @@ -104,7 +108,9 @@ export default [ ...Object.keys(pkg.devDependencies || {}), ], plugins: [ - pluginTypescript(), + pluginTypescript({ + tsconfig: './tsconfig.json' + }), pluginCommonjs({ extensions: ['.js', '.ts'], }), diff --git a/tsconfig.json b/tsconfig.json index f7daf8f..da5cd03 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,6 @@ { + "include": ["src"], + "exclude": ["dist"], "compilerOptions": { /* Visit https://aka.ms/tsconfig.json to read more about this file */ @@ -42,12 +44,12 @@ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ // "declarationMap": true, /* Create sourcemaps for d.ts files. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ - // "outDir": "./", /* Specify an output folder for all emitted files. */ + "outDir": "dist", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ @@ -63,7 +65,7 @@ // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + "declarationDir": ".", /* Specify the output directory for generated declaration files. */ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ /* Interop Constraints */