What is the expected behavior for root & mount for loadConfiguration
's API ?
#2307
-
Hi there! I've updated my project to Snowpack 3 that was using the beta API for My project is a build tool that abstracts Snowpack (= having fun building a SvelteKit alternative). So my goal is to use a // ./tool/cli.js
const snowpackConfig = await loadConfiguration(
{
root: path.join(__dirname, "../client"),
},
path.join(__dirname, "./snowpack.config.json")
); // ./tool/snowpack.config.json
{
"mount": {
"src": "/"
}
} However, if I do this, the files in I have a workaround where I remove everything from the Here is a repo reproducing what I've explained above : https://github.com/JulienPradet/snowpack-ssr-root-issue To see the error, you'd have to run: yarn install
node cli/server.js In the If I don't make sense, feel free to tell me! I'll try a better explanation :D And thank you all for your work on Snowpack! Such a great tool! 🙌 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
How about using The |
Beta Was this translation helpful? Give feedback.
How about using
createConfiguration()
instead? When you use that API, everything is relative to theroot
value instead of the loaded config file path.loadConfiguration()
should really be used only to load a user's configuration file.The
extends
config acts a bit more like what you want (everything extended is still relative to the user's root). You could also use that in combination withcreateConfiguration
.