Closed arackaf closed 3 years ago
Right now it doesn't appear as though you can build a Svelte component with webpack that's fit for SSR. One big reason you might want to do that is to take advantage of webpack path resolution, ie
resolve: { extensions: [".mjs", ".ts", ".tsx", ".js", ".svelte"], modules: [path.resolve("./"), path.resolve("./node_modules")],
which allows you to import things from, say,
import { foo } from "app/a/b/c/d/foo.js"
rather than
import { foo } from "../../../d/foo.js"
This PR exposes the "generate" compile option to the plugin, for this purpose.
So sorry for the churn. I missed that this prop is already passed through, here
https://github.com/sveltejs/svelte-loader/blob/d4e2c2025e8cf0cf448d61a5f5206d6e77ee0d9a/index.js#L132
Right now it doesn't appear as though you can build a Svelte component with webpack that's fit for SSR. One big reason you might want to do that is to take advantage of webpack path resolution, ie
which allows you to import things from, say,
rather than
This PR exposes the "generate" compile option to the plugin, for this purpose.