Skip to content

Resolved path to babel runtime helpers is broken in Windows #290

@johannes-z

Description

@johannes-z
  • Rollup Plugin Name: @rollup/plugin-commonjs (or @rollup/plugin-node-resolve)
  • Rollup Plugin Version: ^11.0.2 (^7.1.1)
  • Rollup Version: ^2.3.1
  • Operating System (or Browser): Windows 10
  • Node Version: 11.13.0

How Do We Reproduce?

export default {
  // ...
  plugins: {
    babel: {
      exclude: 'node_modules/**',
      extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'],
      presets: [
        [
          '@vue/cli-plugin-babel/preset',
          {
            corejs: 3,
            modules: false,
            useBuiltIns: 'usage',
          },
        ],
      ],
      runtimeHelpers: true,
    },
    resolve(),
    commonjs(),
  }
}

Expected Behavior

Successful build and runable file.

Actual Behavior

Adding commonjs to the plugin section breaks the final build, because the path is not correctly resolved on windows. rollup-plugin-vue has a similar issues, where Backslashes are missing from the path:

(!) Unresolved dependencies

C:UsersjohanneszProjectsMyproject
untime/helpers/typeof (imported by ..\..\..\node_modules\regenerator-runtime\runtime.js,  C:UsersjohanneszProjectsMyproject
untime/helpers/typeof?commonjs-external

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