We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
vite
1 parent 04eeae7 commit 4ca06acCopy full SHA for 4ca06ac
lib/plugin.js
@@ -1,8 +1,9 @@
1
import dayjs from 'dayjs'
2
3
<%= options.locales.map(l => `import 'dayjs/locale/${l}'`).join('\n') %>
4
+<%= options.plugins.map(l => `import ${l.replace(/[^A-Za-z]/g, '_')} from 'dayjs/plugin/${l}'`).join('\n') %>
5
-<%= options.plugins.map(l => `dayjs.extend(require('dayjs/plugin/${l}'))`).join('\n') %>
6
+<%= options.plugins.map(l => `dayjs.extend(${l.replace(/[^A-Za-z]/g, '_')})`).join('\n') %>
7
8
<% if (options.defaultLocale) { %>
9
dayjs.locale('<%= options.defaultLocale %>')
0 commit comments