Skip to content

Can't exclude files using babel.config.js #4923

Closed
@adriaanmeuris

Description

@adriaanmeuris

Version

4.1.0

Reproduction link

https://github.com/adriaanmeuris/cli-plugin-babel-issue-repro

Environment info

  System:
    OS: macOS 10.15.1
    CPU: (4) x64 Intel(R) Core(TM) i5-6287U CPU @ 3.10GHz
  Binaries:
    Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.12.1 - ~/.nvm/versions/node/v10.16.3/bin/npm
  Browsers:
    Chrome: 78.0.3904.108
    Firefox: 70.0
    Safari: 13.0.3
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.1.2 
    @vue/babel-preset-app:  4.1.1 
    @vue/babel-preset-jsx:  1.1.2 
    @vue/babel-sugar-functional-vue:  1.1.2 
    @vue/babel-sugar-inject-h:  1.1.2 
    @vue/babel-sugar-v-model:  1.1.2 
    @vue/babel-sugar-v-on:  1.1.2 
    @vue/cli-overlay:  4.1.1 
    @vue/cli-plugin-babel: 4.1.0 => 4.1.0 
    @vue/cli-plugin-eslint: 4.1.1 => 4.1.1 
    @vue/cli-plugin-router:  4.1.1 
    @vue/cli-plugin-vuex:  4.1.1 
    @vue/cli-service: 4.1.1 => 4.1.1 
    @vue/cli-shared-utils:  4.1.1 
    @vue/component-compiler-utils:  3.0.2 
    @vue/eslint-config-prettier: 6.0.0 => 6.0.0 
    @vue/preload-webpack-plugin:  1.1.1 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: 6.0.1 => 6.0.1 
    portal-vue: 2.1.6 => 2.1.6 
    vue: 2.6.10 => 2.6.10 
    vue-esc: 3.0.1 => 3.0.1 
    vue-eslint-parser:  6.0.5 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  15.7.2 
    vue-mq: 1.0.1 => 1.0.1 
    vue-mutation-observer: 0.1.2 => 0.1.2 
    vue-style-loader:  4.1.2 
    vue-template-compiler: 2.6.10 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
    vuex: 3.1.2 => 3.1.2 
  npmGlobalPackages:
    @vue/cli: 4.1.1

Steps to reproduce

  1. create a babel.config.js file that excludes a file:
// Export the babel config
  module.exports = {
    presets: ['@vue/cli-plugin-babel/preset'],

    // Exclude from transpilation
    exclude: [
      /(ignoreme\.). /, // Exclude filenames containing `ignoreme`
    ],
  };
  1. start the devServer: npm run serve
  2. following error triggers: Error: Configuration contains string/RegExp pattern, but no filename was passed to Babel

No error occurs when reverting @vue/cli-plugin-babel to 4.0.5.

What is expected?

No error occurs when starting the devServer.

What is actually happening?

Following error is shown: Error: Configuration contains string/RegExp pattern, but no filename was passed to Babel

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions