Skip to content

tsconfig.json "includes" brings entire folder with glob selecting #25646

@lucasnorman

Description

@lucasnorman

TypeScript Version: 2.9.2 (Tried typescript@next as well)

Search Terms:
typescript glob includes root folder

I have two services. Both have the same package.json, tsconfig.json, and tsconfig.server.json which i will post below.

Code

tsconfig.server.json:

{
    "extends": "./tsconfig.json",
    "compilerOptions": {
     "noUnusedParameters": false,
    "module": "commonjs",
    "outDir": "./production-server"
    },
    "include": ["./server/api/**/*.ts"]
}

tsconfig.json:

{
    "compileOnSave": false,
    "compilerOptions": {
        "target": "esnext",
        "module": "esnext",
        "jsx": "preserve",
        "allowJs": true,
        "moduleResolution": "node",
        "allowSyntheticDefaultImports": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "removeComments": true,
        "preserveConstEnums": true,
        "sourceMap": true,
        "skipLibCheck": true,
        "baseUrl": ".",
        "typeRoots": ["./node_modules/@types"],
        "lib": ["dom", "es2016", "es2017"]
    }
}

package.json:

"dependencies": {
    "@types/bcrypt": "^2.0.0",
    "@types/cors": "^2.8.4",
    "@types/js-cookie": "^2.1.0",
    "apollo-cache-inmemory": "^1.1.11",
    "apollo-client": "^2.2.7",
    "apollo-fetch": "^0.7.0",
    "apollo-link": "^1.2.1",
    "apollo-link-http": "^1.5.3",
    "apollo-server-core": "^1.3.2",
    "apollo-server-express": "^1.3.2",
    "apollo-server-module-graphiql": "^1.3.2",
    "bcrypt": "^2.0.1",
    "body-parser": "^1.18.2",
    "cors": "^2.8.4",
    "enzyme": "^3.3.0",
    "express": "^4.16.3",
    "graphql": "^0.11.7",
    "graphql-anywhere": "^4.0.2",
    "graphql-import": "^0.4.5",
    "graphql-tag": "^2.5.0",
    "graphql-tools": "^2.22.0",
    "isomorphic-unfetch": "^2.0.0",
    "js-cookie": "^2.2.0",
    "jsonwebtoken": "^8.2.1",
    "mongodb": "^3.0.10",
    "next": "^6.0.3",
    "nodemailer": "^4.6.6",
    "prop-types": "^15.6.1",
    "react": "^16.2.0",
    "react-apollo": "^2.0.4",
    "react-dom": "^16.2.0",
    "react-dropzone": "^4.2.9",
    "request-promise": "^4.2.2",
    "sinon": "^5.0.10",
    "styled-components": "^3.2.2",
    "winston": "^3.0.0-rc5"
},
"devDependencies": {
    "@babel/core": "7.0.0-beta.44",
    "@fortawesome/fontawesome-free-solid": "^5.0.9",
    "@playlyfe/gql": "^2.6.0",
    "@types/body-parser": "^1.16.8",
    "@types/connect": "^3.4.31",
    "@types/enzyme": "^3.1.10",
    "@types/graphql": "^0.12.4",
    "@types/jest": "^22.2.3",
    "@types/jsonwebtoken": "^7.2.6",
    "@types/mongodb": "^3.0.13",
    "@types/multer": "^1.3.6",
    "@types/next": "2.4.11",
    "@types/node": "^10.3.2",
    "@types/nodemailer": "^4.6.0",
    "@types/react": "^16.4.2",
    "@types/react-dropzone": "^4.2.0",
    "@types/react-router": "^4.0.22",
    "@types/react-test-renderer": "^16.0.1",
    "@types/request-promise": "^4.1.41",
    "@types/winston": "^2.3.9",
    "@zeit/next-typescript": "^0.1.1",
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "^23.2.0",
    "babel-loader": "^7.1.2",
    "babel-plugin-inline-dotenv": "^1.1.2",
    "babel-plugin-inline-import-data-uri": "^1.0.1",
    "babel-plugin-styled-components": "^1.5.1",
    "babel-plugin-transform-es2015-destructuring": "^6.23.0",
    "babel-plugin-transform-inline-environment-variables": "^0.4.1",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-polyfill": "^6.26.0",
    "babel-preset-env": "^1.6.1",
    "babel-preset-react": "^6.24.1",
    "enzyme-adapter-react-16": "^1.1.1",
    "font-awesome": "^4.7.0",
    "fork-ts-checker-webpack-plugin": "^0.4.1",
    "jest": "^23.0.0",
    "jest-localstorage-mock": "^2.2.0",
    "node-fetch": "^2.1.2",
    "nodemon": "^1.17.2",
    "react-dropzone": "^4.2.9",
    "react-test-renderer": "^16.4.0",
    "request": "^2.85.0",
    "source-map-loader": "^0.2.3",
    "styled-theming": "^2.2.0",
    "stylelint-config-styled-components": "^0.1.1",
    "ts-jest": "^22.4.6",
    "ts-node": "^5.0.1",
    "tslint": "^5.9.1",
    "tslint-react": "^3.5.1",
    "typescript": "^2.9.2",
    "typescript-eslint-parser": "^16.0.1",
    "update-check": "^1.3.2"
}

Expected behavior:

Compile files in the server folder and place them in production-server.

Actual behavior:

One service acts as above. The other places the whole server folder in production-server instead of all subfolders/files and doesn't included any base files. Folder structure below:

/server
    api/
        **
    interfaces/
        **
    utils/
        **
    index.ts
    gqlSchemaResolverInit.ts

/server is copied over with it's subfolders/files, however index.ts and gqlSchemaResolverInit.ts are not. Again, only happening for one service.

Playground Link: None right now. This seems very isolated for some reason. All versions are the same. Note this happens on deployment to a k8s cluster as well so it shouldn't be the local machine.

Please let me know if more information is needed. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions