Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not creating index.d.ts file -- no tsconfig present #229

Closed
tamb opened this issue May 30, 2020 · 3 comments
Closed

Not creating index.d.ts file -- no tsconfig present #229

tamb opened this issue May 30, 2020 · 3 comments
Labels
kind: support Asking for support with something or a specific use case problem: needs more info This issue needs more information in order to handle it solution: invalid This doesn't seem right

Comments

@tamb
Copy link

tamb commented May 30, 2020

What happens and why it is wrong

This does not output a types declaration even with the config option set

Environment

Windows 10

Versions

  • typescript: 3.9.3
  • rollup: 2.11.2
  • rollup-plugin-typescript2: 0.27.1

rollup.config.js

import { terser } from "rollup-plugin-terser";
import babel from "@rollup/plugin-babel";
import typescript from "rollup-plugin-typescript2";

export default [
  {
    input: "src/polyfill.js",
    output: {
      file: "dist/polyfill.js",
      format: "umd",
    },
    plugins: [
      terser({
        compress: true,
      }),
      babel({
        exclude: "node_modules/**",
      }),
    ],
  },
  {
    input: "src/index.ts",
    output: {
      file: "dist/index.js",
      format: "umd",
      name: "byString",
    },
    plugins: [
      terser({
        compress: true,
      }),
      babel({
        exclude: "node_modules/**",
      }),
      typescript({
        declaration: true,
      }),
    ],
  },
];

tsconfig.json

none

package.json

{
  "name": "object-bystring",
  "version": "4.1.1",
  "description": "Access and alter objects using string literals",
  "main": "dist/index.js",
  "scripts": {
    "test": "node clean && npx rollup -c rollup.config.js && jest && node examples/example.js && node addExports.js",
    "build": "npm run test",
    "safe-publish": "npm test && npm publish"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/tamb/object-bystring.git"
  },
  "keywords": [
    "object",
    "bystring",
    "string",
    "utility",
    "mutable"
  ],
  "author": "tamb <tsaporito@fastmail.com>",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/tamb/object-bystring/issues"
  },
  "files": [
    "LICENSE",
    "README.md",
    "dist"
  ],
  "types": "dist/index.d.ts",
  "homepage": "https://github.com/tamb/object-bystring#readme",
  "devDependencies": {
    "@rollup/plugin-babel": "^5.0.2",
    "husky": "^4.2.5",
    "jest": "^26.0.1",
    "prettier": "^2.0.5",
    "pretty-quick": "^2.0.1",
    "rimraf": "^3.0.2",
    "rollup": "^2.11.2",
    "rollup-plugin-terser": "^6.1.0",
    "rollup-plugin-typescript2": "^0.27.1",
    "typescript": "^3.9.3"
  },
  "husky": {
    "hooks": {
      "pre-commit": "pretty-quick --staged"
    }
  }
}

plugin output with verbosity 3

@agilgur5
Copy link
Collaborator

I'm not totally sure, but it might not work without a tsconfig.json, the TS compiler uses include: or files: to determine what to generate, so there might be an issue there.

@tamb
Copy link
Author

tamb commented Jul 19, 2020

I'll definitely try that and update

@ezolenko ezolenko added the problem: needs more info This issue needs more information in order to handle it label Aug 7, 2020
@hellomrbigshot
Copy link

hellomrbigshot commented Oct 11, 2021

tsconfig.json

{
  "compilerOptions"{
    // ...
    "declaration": true
  }
}

@tamb tamb closed this as completed Oct 29, 2021
@agilgur5 agilgur5 added solution: invalid This doesn't seem right kind: support Asking for support with something or a specific use case labels Apr 29, 2022
@agilgur5 agilgur5 changed the title Not creating index.d.ts file Not creating index.d.ts file -- no tsconfig present Apr 29, 2022
Repository owner locked as resolved and limited conversation to collaborators May 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: support Asking for support with something or a specific use case problem: needs more info This issue needs more information in order to handle it solution: invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

4 participants