Skip to content

Contribute problem matcher for the webpack ts-loader #29619

Closed

Description

@egamma

I'm using an angular starter kit https://github.com/AngularClass/angular-starter to create an angular app and I wanted to setup tasks and a problem matcher for the build.

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "npm",
            "script": "build",
            "problemMatcher": [
                "$tsc"
            ]
        }
    ]
}

However, TS loader for web pack is using a different error message format than tsc, see below. It would be good to have a predefined problem matcher.

ERROR in [at-loader] ./src/app/environment.ts:4:9
    TS1005: ';' expected.

Activity

  1. added
    tasks
    on Jun 27, 2017
  2. added
    typescript
    and removed
    tasks
    on Jun 27, 2017
  3. rozzzly commented on Jun 27, 2017

    @rozzzly

    I'd like to point out that the project you link to, AngularClass/angular-starter is not using the default ts-loader but actually awesome-typescript-loader ( le proof is in teh pudding 🍮 ) which I actually use myself.

    IIRC, the $tsc watcher doesn't work for ts-loader either, so preferably someone could write one for both loaders seeing as they're pretty prominent.

    I'll try to define my own and then contribute it.

  4. egamma commented on Jul 4, 2017

    @egamma
    MemberAuthor

    Patrick Lienau (@rozzzly) thanks for pointing this out please keep us posted on your progress for defining a problem matcher. Since problem matchers can be contributed by extensions please consider to make the matcher also available as an extension.

    Matt Bierner (@mattbierner) thinking about this again, the web pack specific problem matchers should not be contributed by the bundled TypeScript extension but by a web pack extension.

    //CC Dirk Bäumer (@dbaeumer)

  5. ragnarol commented on Jul 5, 2017

    @ragnarol

    I have created my own matcher and works quite well. I will try to contribute it as an extension to:

    "problemMatcher": {
    	"owner": "webpack",
    	"severity": "error",
    	"fileLocation": "relative", 
    	"pattern": [
    		{
    			"regexp": "ERROR in \\[at-loader\\] ([^:]*):(\\d+):(\\d+)",	
    			"file" : 1,
    			"line": 2,
    			"column": 3
    		},
    		{
    			"regexp": "TS(.*)",	
    			"message": 1
    		}
    	]
    	
    }
    
  6. ragnarol commented on Jul 8, 2017

    @ragnarol
  7. edvinv commented on Jul 18, 2017

    @edvinv

    What about webpack running in watch mode? For background task you need to define begins/endsPattern, but for both ts-loader and awesome-typescript-loader, there is no good hook to detect task end.

  8. ragnarol commented on Jul 18, 2017

    @ragnarol

    Edvin Vidmar (@edvinv) I will have a look, if you create an issue in the extension repository would be great :)

  9. edvinv commented on Jul 24, 2017

    @edvinv

    Juan (@ragnarol) , thx but I don't think that you can do anything in extension. Problem is that webpack, doesn't generate any solid compilation start/end message, so you can not detect process end which is required by vscode. Possible solution is to make endPattern optional, more here #25161.

  10. Lixire commented on Aug 8, 2017

    @Lixire
    Contributor

    If anyone's interested, I've made a ts-loader problem matcher here: https://marketplace.visualstudio.com/items?itemName=alqiu.ts-loader-problem-matcher . If there are any errors that I didn't capture or there's something wrong with the regex, don't hesitate to raise an issue in the repo.

  11. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

typescript

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions