sveltejs / rollup-plugin-svelte

Compile Svelte components with Rollup
MIT License
505 stars 79 forks source link

hooks don't work #96

Closed tborychowski closed 4 years ago

tborychowski commented 4 years ago

When I build my project using rollup and this plugin, I get a bunch of console messages:

The "resolveId" hook used by the output plugin svelte is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.
The "load" hook used by the output plugin svelte is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.
The "transform" hook used by the output plugin svelte is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.

node: 12.13.0 svelte: 3.18.2 rollup: 1.31.1 rollup-plugin-svelte: 5.1.1

maxmilton commented 4 years ago

Since you're using a non-standard setup with gulp + gulp-rollup-lightweight it may be hard for anyone here to help. That said, I suggest placing rollup-plugin-svelte after @rollup/plugin-node-resolve in your rollup plugins.

Interesting project though. I had a go at something similar myself; https://github.com/MaxMilton/new-tab

Conduitry commented 4 years ago

This sounds like a support question for https://github.com/b1lly/gulp-rollup-lightweight if anything. I do note that that repo has 1 star (by its author), no issues, no pull requests, and hasn't been updated in a year - so if I were you, I would pick some less obscure tooling.

Those message are coming from Rollup in https://github.com/rollup/rollup/pull/3218 it looks like, but this isn't the right place to ask someone to help you look into how this plugin is calling Rollup's API.

tborychowski commented 4 years ago

Thanks. The problem is that rollup has no good gulp plugin.

tborychowski commented 4 years ago

@Conduitry thanks for pointing me in this direction. I was able to fix the issue.

The problem was that this plugin (gulp-rollup-lightweight) was passing rollup config as inputOptions and outputOptions, and rollup js api requires that these are separate. (and some plugins only work as input, whereas others - only as output).