Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adriaanmeuris opened this issue Dec 3, 2019 · 3 comments · Fixed by #4924
Closed

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

adriaanmeuris opened this issue Dec 3, 2019 · 3 comments · Fixed by #4924

Comments

@adriaanmeuris
Copy link

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

@haoqunjiang
Copy link
Member

Got it. It's due to this line:

babel.loadPartialConfig()

@adriaanmeuris
Copy link
Author

quick question: this issue is closed but not fixed in the current version. Is there any indication in which version this will land and/or what the schedule is for releasing this new version?

@haoqunjiang
Copy link
Member

Sorry for the delay. I'll release a new version this weekend.

I didn't do the release earlier because I was going to take vacation earlier this month and then the holiday season arrived, so I'm afraid that people wouldn't have the capacity to deal with possible regressions in the new release.

Now that I'm back to work I'll do the release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants