Skip to content

ts-loader ignores exclude in webpack loader config #544

@quantuminformation

Description

@quantuminformation

Webpack is using this, which should explicitly ignore the test folder.

      {
        test: /\.ts$/,
        use: [{
          loader: 'ts-loader'
          //loader: 'awesome-typescript-loader'

        }]
        ,
        exclude: '/**/*.test.ts'
      }

but it tried to compile my tests (which results in a failing as tests run in node and the webpack build doesn't expect assert to be available in a browser build )

ERROR in /Users/nikos/WebstormProjects/solar-popup/src/tests/SolarPopup.test.ts
(2,20): error TS2307: Cannot find module 'assert'.

The browser webpack build targets es2015:

{
  "compilerOptions": {
    "target": "es2015",
    "declaration": true
  },
  "exclude": [
    "node_modules",
    "demo"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions