vkurko / calendar

Full-sized drag & drop JavaScript event calendar with resource & timeline views
https://vkurko.github.io/calendar/
MIT License
969 stars 82 forks source link

ES6 version is pulling Svelte dependency #288

Closed jpaulomotta closed 1 week ago

jpaulomotta commented 1 week ago

Hello,

I'm trying to spin up an ES6 example here on my end, but when trying to build the component I'm facing the following error:

Failed to compile.

./node_modules/@event-calendar/core/index.js
Module not found: Error: Can't resolve 'svelte/internal' in '/Users/Foo/code/my_project/node_modules/@event-calendar/core'

This is the code that I'm using so far:

import Calendar from '@event-calendar/core';
import TimeGrid from '@event-calendar/time-grid';

let ec = new Calendar({
    target: document.getElementById('ec'),
    props: {
        plugins: [TimeGrid],
        options: {
            view: 'timeGridWeek',
            events: [
                // your list of events
            ]
        }
    }
});

My stack is using webpack, and the version 3.0.2 of this library.

Is Svelte a dependency? I had the impression that it wasn't by reading the docs.

woofer696 commented 1 week ago

Hello,

I just installed the project with webpack 5.92.0 so it doesn't look like it's a library problem, look into updating the webpack.

vkurko commented 1 week ago

The @event-calendar/core package depends on the svelte package and this is specified in package.json. Therefore, when installing @event-calendar/core, svelte (read svelte/internal) must also be installed automatically. I don't know why it didn't work for you.