Replies: 1 comment 3 replies
-
|
In fact, it should even be placed after we merge all module.exports = function plugin(snowpackConfig, pluginOptions = {}) {
let svelteOptions;
let preprocessOptions;
const userSvelteConfigLoc = path.join(process.cwd(), "svelte.config.js");
if (fs.existsSync(userSvelteConfigLoc)) {
const userSvelteConfig = require(userSvelteConfigLoc);
const { preprocess, ..._svelteOptions } = userSvelteConfig;
preprocessOptions = preprocess;
svelteOptions = _svelteOptions;
}
// Generate svelte options from user provided config (if given)
svelteOptions = {
dev: process.env.NODE_ENV !== "production",
css: false,
...svelteOptions,
...pluginOptions,
};
// Support importing Svelte files when you install dependencies.
snowpackConfig.installOptions.rollup.plugins.push(
svelteRollupPlugin({ include: "**/node_modules/**", ...svelteOptions })
);
........... |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I am so sorry that I don't have time to expand on this and test thoroughly but if I don't post now I will never do it...
The issue is there.
I think this is only relevant when we start playing with SSR and we import components from
node_modules.If we don't do that, we get
<Component> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules.I am not using Snowpack the way most people do so this info should be verified in a more typical context.
Beta Was this translation helpful? Give feedback.
All reactions