nathanreyes / v-calendar

An elegant calendar and datepicker plugin for Vue.
https://vcalendar.io
MIT License
4.39k stars 859 forks source link

Build Vue3 library error #994

Closed hirenreshamwala closed 2 years ago

hirenreshamwala commented 3 years ago

https://github.com/nathanreyes/vue3-component-library

After clone and install I am building js using yarn build:js command but I am getting the following error.

yarn run v1.22.17
$ rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js

./src/index.ts, ./src/components/Calendar/index.ts, ./src/components/CalendarDay/index.ts, ./src/components/CalendarNav/index.ts, ./src/components/CalendarPane/index.ts, ./src/components/CustomTransition/index.ts, ./src/components/DatePicker/index.ts, ./src/components/Grid/index.ts, ./src/components/Popover/index.ts, ./src/components/PopoverRow/index.ts, ./src/components/SvgIcon/index.ts, ./src/components/TimePicker/index.ts, ./src/components/TimeSelect/index.ts → dist/esm...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
created dist/esm in 23.8s

src/index.ts → dist/vuelib.esm.js...
created dist/vuelib.esm.js in 14.1s

./src/components/Calendar/index.ts → dist/components/Calendar/index.ts...
created dist/components/Calendar/index.ts in 12.4s

./src/components/CalendarDay/index.ts → dist/components/CalendarDay/index.ts...
created dist/components/CalendarDay/index.ts in 8.4s

./src/components/CalendarNav/index.ts → dist/components/CalendarNav/index.ts...
(!) Unused external imports
createCommentVNode imported from external module 'vue' but never used
created dist/components/CalendarNav/index.ts in 7.4s

./src/components/CalendarPane/index.ts → dist/components/CalendarPane/index.ts...
(!) Unused external imports
createCommentVNode imported from external module 'vue' but never used
created dist/components/CalendarPane/index.ts in 8.8s

./src/components/CustomTransition/index.ts → dist/components/CustomTransition/index.ts...
(!) Unused external imports
createVNode imported from external module 'vue' but never used
created dist/components/CustomTransition/index.ts in 1.3s

./src/components/DatePicker/index.ts → dist/components/DatePicker/index.ts...
created dist/components/DatePicker/index.ts in 10s

./src/components/Grid/index.ts → dist/components/Grid/index.ts...
created dist/components/Grid/index.ts in 1.4s

./src/components/Popover/index.ts → dist/components/Popover/index.ts...
(!) Unused external imports
createVNode imported from external module 'vue' but never used
created dist/components/Popover/index.ts in 4.1s

./src/components/PopoverRow/index.ts → dist/components/PopoverRow/index.ts...
created dist/components/PopoverRow/index.ts in 6.3s

./src/components/SvgIcon/index.ts → dist/components/SvgIcon/index.ts...
created dist/components/SvgIcon/index.ts in 1.3s

./src/components/TimePicker/index.ts → dist/components/TimePicker/index.ts...
created dist/components/TimePicker/index.ts in 4.9s

./src/components/TimeSelect/index.ts → dist/components/TimeSelect/index.ts...
created dist/components/TimeSelect/index.ts in 1.3s

./src/index.ts → dist/vuelib-browser.min.js...
[!] Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files)
src/utils/defaults/screens.json (2:6)
1: {
2:   "sm": "640px",
         ^
3:   "md": "768px",
4:   "lg": "1024px",
Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files)
    at error (/Volumes/MacintoshHD/Node/vue3-component-library/node_modules/rollup/dist/shared/rollup.js:5251:30)
    at Module.error (/Volumes/MacintoshHD/Node/vue3-component-library/node_modules/rollup/dist/shared/rollup.js:9810:16)
    at tryParse (/Volumes/MacintoshHD/Node/vue3-component-library/node_modules/rollup/dist/shared/rollup.js:9691:23)
    at Module.setSource (/Volumes/MacintoshHD/Node/vue3-component-library/node_modules/rollup/dist/shared/rollup.js:10114:19)
    at ModuleLoader.addModuleSource (/Volumes/MacintoshHD/Node/vue3-component-library/node_modules/rollup/dist/shared/rollup.js:18275:20)
    at ModuleLoader.fetchModule (/Volumes/MacintoshHD/Node/vue3-component-library/node_modules/rollup/dist/shared/rollup.js:18331:9)
    at async Promise.all (index 2)
    at ModuleLoader.fetchStaticDependencies (/Volumes/MacintoshHD/Node/vue3-component-library/node_modules/rollup/dist/shared/rollup.js:18356:34)
    at async Promise.all (index 0)
    at ModuleLoader.fetchModule (/Volumes/MacintoshHD/Node/vue3-component-library/node_modules/rollup/dist/shared/rollup.js:18333:9)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
nathanreyes commented 2 years ago

Vue 3 version now uses Vite for the build process so this shouldn't be an issue anymore.