sveltejs / svelte-loader

Webpack loader for svelte components.
MIT License
594 stars 73 forks source link

Maintain the damn tamplates #230

Closed nextgenthemes closed 1 year ago

nextgenthemes commented 1 year ago

I have to complain about this. https://github.com/sveltejs/template-webpack

I just watched a doc for Svelte and Rich was saying his goal is not adoption but barrier of entry. This is supposedly an offical loader. Yet the template it links to us not maintained. It installs outdated and insecure npm packages. There are already PRs with various fixes w8ing. Updating to the latest packages now gives me:

[webpack-cli] webpack Dev Server Invalid Options

options should NOT have additional properties

I even downgraded webpack-cli and server to the the latest major versions but this does not even fix this, removing the options does not fix it either. If this is supposed to be official then provide a command to start a damn webpack app with the latest (or at least secure) packages.

Furthermore there should be a template that has typescript by default, not some script that transforms the project to typescript as this will also be error prove and not good maintainable. I get that vite is the main official builder but do not claim this is official and then send people into a trail and error hell.

There are Github helpers like depandabot and github actions to test shit, this can and should be at least partially automated. The deps tree is not that big, it should not be that much work to have a up-to-date template for a basic typescript svelte app with webpack.

Just wasted an hour on this BS and my boner for Svelte is limb now.

syvb commented 1 year ago

Just so you know, Webpack isn't the preferred way to bundle Svelte apps. Webpack support isn't very actively maintained and is mostly a community effort - see #206. SvelteKit is probably the way to go for new stuff.

nextgenthemes commented 1 year ago

@syvb I know this, i mentioned vite in my comment, did you actually read it? They call the webpack builder "official". If they can even have someone approve some PRs for a basic starter template they should remove the official label.

Found out you run npm audit --force it updates webpack-server only and that way it works keeping webpack-cli at 4.x

Then you have to remove the --basedir and replace it with a config (has already a PR with it)

And when running the typescript transform you get an outdated TS with errors so you need to update that as well. The updated base ts config also takes care or a deprecated option. So you basically can update everyone except webpack-cli I guess.

Is Webpack not the worlds most popular bundler right now? I get that Svelte community is small but this is VERY concening. I expect more from something that is supposedly is loved by everyone and mature.

I am trying to integrate this with my monorepo that I use for all my projects with an already pretty complex webpack setup I do not want use another bundler for many reasons.

And I for sure do not need Sveltekit I do not need to build some complex app nor do I need SSR or whatever shit it does, I am just doing some simple things in a single page.

benmccann commented 1 year ago

Is Webpack not the worlds most popular bundler right now?

It's not in the Svelte community. Vite gets 8x more usage and the gap is growing: https://npmcharts.com/compare/svelte-loader,@sveltejs/vite-plugin-svelte

Anyway, I updated and merged that PR (https://github.com/sveltejs/template-webpack/pull/51)