-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Pre-bundling questions #1724
Labels
Comments
Sigh... this is really messed up:
|
thank |
Provide a temperary workaround here:
// vite.config.js
export default {
// other config
resolve: {
alias: [
// make moment to be a resolvable ESM
{ find: /^moment$/, replacement: path.resolve(__dirname, './alias/moment.js') },
],
},
}
// absolute path to moment in node_modules
import moment from '../../node_modules/moment';
export const {
fn,
min,
max,
now,
utc,
unix,
months,
isDate,
locale,
invalid,
duration,
isMoment,
weekdays,
parseZone,
localeData,
isDuration,
monthsShort,
weekdaysMin,
defineLocale,
updateLocale,
locales,
weekdaysShort,
normalizeUnits,
relativeTimeRounding,
relativeTimeThreshold,
calendarFormat,
} = moment;
export default moment; |
6 tasks
6 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
In beta.36, import moment. It is a function
In beta.49, import moment. It is a Object
Is this expected or a bug?Why the two results are inconsistent
Reproduction
System Info
vite
version: bete.49The text was updated successfully, but these errors were encountered: