Skip to content

Pre-bundling questions #1724

@anncwb

Description

@anncwb

⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.

  • Read the docs.
  • Use Vite >=2.0. (1.x is no longer supported)

Describe the bug

In beta.36, import moment. It is a function

import moment from 'moment'

console.log(moment)

=>

ƒ hooks() {
 return hookCallback.apply(null, arguments);
 }

In beta.49, import moment. It is a Object

import moment from 'moment'

console.log(moment)

=>

 {__esModule: true}
default: (...)
__esModule: true
get default: () => moment_default
__proto__: Object
}

Is this expected or a bug?Why the two results are inconsistent

Reproduction

System Info

  • vite version: bete.49
  • Operating System: mac
  • Node version: 12
  • Package manager (npm/yarn/pnpm) and version:yarn

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