foxfriends / root

Play Root online with friends. Original board game by Cole Wehrle, with art by Kyle Ferrin
6 stars 1 forks source link

Add Rollup bundler with Babel/Eslint #11

Closed agdust closed 3 years ago

agdust commented 3 years ago

I tried to implement all cool things in Parcel, but it seems that its packages not diverse and mature enough. Even with Rollup, which is more popular, I had some issues

Partially closes #7 and #9

Here is list of all things that I tried to add to this project :heavy_check_mark: Babel -- just works, all is fine :heavy_check_mark: Eslint -- needs special rules tuning for Svelte, but works :x: Postcss -- for some reasons, rollup-plugin-svelte falls with error when I tries to extract css, and postcss just doesn't have code to work with :x: Stylelint -- same as Postcss :x: Typescript -- typescript itself work fine, but svelte parser for eslint doesn't understand it

Though stylelint config didn't work, I left it's config for IDE support (IDE supports all things out-of-the-box, and bundlers don't, lmao)

agdust commented 3 years ago

So, I fixed code due to your comments, except of this ones:

  1. No-multiple-empty-lines rule works wrong with svelte components when set to 1, it's just sees empty lines where there are none of them
  2. No-unused-vars I've set to warn, because of svelte-specific $-syntax. If we'll find the way to fix it we can set it back to error

There are still some issues and warnings of linter, but they can be fixed in future

The serve plugin of Rollup just serves the files like Parcel did, I've turned it on only for non-production environment

I can fix also issues like cover, I think that it'll be better to remove all image importing in this cases. But maybe better to do it in another PR, I have not enough time to do it in next few days

foxfriends commented 3 years ago

Ah ok strange. Thanks for setting this up!