Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

What is correct behaviour if tsconfig has only files property with entry point? #97

Closed
aspirisen opened this issue Feb 6, 2016 · 1 comment

Comments

@aspirisen
Copy link

In tsconfig.json i set the entry point of my app. As i set files property i shouldn't set exclude property as it is written in TS docs. Also, VS Code doesn't work correctly if tsconfig.json has both options. So, when i run tsc everything works ok. When i run it in webpack i see a warning message that i should set exclude property when resolveGlobs is true. I set it to false but then the built becomes corrupted. Everything works correct with resolveGlobs: true but this warning is annoying.

tsconfig.json

{
    "compilerOptions": {
        "module": "commonjs",
        "noImplicitAny": true,
        "removeComments": true,
        "preserveConstEnums": true,
        "jsx": "react"
    },
    "files": [
      "app.tsx",
      "typings/tsd.d.ts"
    ]
}

webpack.config.js

var webpack = require('webpack');

module.exports = {

    entry: {
      app: "./app.tsx"
    },

    context: __dirname,

    output: {
        path: __dirname + "/dist",
        filename: "[name].js?[hash]"
    },

    resolve: {
        root: __dirname,
        extensions: ['', '.js', '.ts', '.tsx']
    },

    module: {
        loaders: [
            {
                test: /\.tsx?$/,
                loader: 'awesome-typescript-loader',
                query: {
                  resolveGlobs: false
                }
            }
        ]
    },

    plugins: [
        new webpack.HotModuleReplacementPlugin()
    ],

    cache: {},

    watchOptions: {
        aggregateTimeout: 100
    },

    devServer: {
        inline: true,
        hot: true
    },
};
@s-panferov
Copy link
Owner

@aspirisen thanks, nice catch! I should remove the warning in this case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants