Skip to content
This repository was archived by the owner on Sep 24, 2020. It is now read-only.
This repository was archived by the owner on Sep 24, 2020. It is now read-only.

Unable to exclude certain paths from webpack build #40

@simon-lang

Description

@simon-lang

Create a fresh install of this boilerplate:

vue init ducksoupdev/vue-webpack-typescript example
cd example
npm install

Add the following to a file outside the src directory, for example server/server.ts

const wrong: notatype = 'test'

Note the invalid typescript syntax.

Now try npm run dev

You will see the error:

ERROR in [at-loader] ./server/server.ts:1:14
    TS2304: Cannot find name 'notatype'.
Child html-webpack-plugin for "index.html":
     1 asset
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html 425 bytes {0} [built]
webpack: Failed to compile.

In the webpack.config.base.js, I try to exclude this folder. e.g.

    {
      test: /\.ts$/,
      exclude: /node_modules/,
      enforce: 'pre',
      loader: 'tslint-loader',
      exclude: ['./server']
    },
    {
      test: /\.ts$/,
      exclude: /node_modules/,
      loader: 'awesome-typescript-loader',
      exclude: ['./server']
    },

But it still appears to be bundling it.

Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions