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

Unable to exclude certain paths from webpack build #40

Open
simon-lang opened this issue May 2, 2018 · 0 comments
Open

Unable to exclude certain paths from webpack build #40

simon-lang opened this issue May 2, 2018 · 0 comments

Comments

@simon-lang
Copy link

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?

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

1 participant