Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade rollup to v2 #24

Open
shirotech opened this issue May 24, 2020 · 6 comments
Open

Upgrade rollup to v2 #24

shirotech opened this issue May 24, 2020 · 6 comments

Comments

@shirotech
Copy link
Contributor

Seems we are still in v1, and it's quite hard adding my own plugins and configurations to the build. Having said that it requires updating some of the existing plugins that you have as there are some breaking changes. For that, I'll really need your help on that one, hope you're happy to do it. Many thanks 😄

@AlexxNB
Copy link
Owner

AlexxNB commented May 24, 2020

Rollup using by @svelte-docs/core only. Users can't use their own rollup.config.js. What existing plugins you want to use and how?
To move on Rollup2 we should rewrite huge amount builtin plugins in core but as I say in #20, I'm going to rewrite core and rewriting plugins in this package may bu useless thing right now

@shirotech
Copy link
Contributor Author

shirotech commented May 24, 2020

Example this is my rollup.config.js

import {htmlResolver, resolvePlugins} from '...';
import conf from '@svelte-docs/core/rollup.config';

const extraPlugins = resolvePlugins(['resolver', 'conf'], {resolver: htmlResolver});
conf[0].plugins.unshift(...extraPlugins); // injecting plugins to main
conf[1].plugins.unshift(...extraPlugins); // injecting plugins to example

conf.push({something}); // this part here breaks, as v1 doesn't support code splitting using object in input

export default conf;

e.g. v1 doesn't support this kind of configuration https://rollupjs.org/guide/en/#input

// rollup.config.js
export default {
  ...,
  input: {
    a: 'src/main-a.js',
    'b/index': 'src/main-b.js'
  },
  output: {
    ...,
    entryFileNames: 'entry-[name].js'
  }
};

To move on Rollup2 we should rewrite huge amount builtin plugins in core but as I say in #20, I'm going to rewrite core and rewriting plugins in this package may bu useless thing right now

If that's the case, I'll look for an alternative solution.

@AlexxNB
Copy link
Owner

AlexxNB commented May 24, 2020

It is tricky and undocumented =)
You may check core plugins, if there are not so much changes and you have a time for test this, feel free to PR.

@shirotech
Copy link
Contributor Author

shirotech commented May 24, 2020

I feel bad hacking the project, but really need it to build using the builtin ***example which imports directly from a component, but that said component requires additional steps etc.

Cool, I'll see if I can upgrade it cleanly, last time I did it wasn't too bad. Will PR later this week as a heads up. Cheers.

@jmsunseri
Copy link

what about a move to snowpack?

@AlexxNB
Copy link
Owner

AlexxNB commented Jan 25, 2021

Yeah! I'm waiting for release to see if it is possible to recreate svelte-docs with svelte-kit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants