Original Discussion: https://github.com/pikapkg/snowpack/discussions/1011
/cc @ralphtheninja
Minimal test case repository by @ralphtheninja (thanks!): https://github.com/ralphtheninja/snowpack-test
Next step would be to create a test in test/build to reproduce the error. Maybe test/build/html-environment-variables) might be a good starting point? Would you like to give that a go and start a pull request with a failing test?
I have a bit of knowledge here! I believe this was introduced by a bad TODO comment that led to this PR: https://github.com/pikapkg/snowpack/pull/846
We actually should have kept using our fork this loader, since env had been added to it. By moving back to the official open-wc package, we lost env support. Reverting that PR (and handling any merge conflicts) would be the solution to this issue.
This is only an issue for the webpack plugin, and not Snowpack's build command.
one of the reasons I'd like to tackle "new plugin tests" separately from any one PR is that there are some questions lurking that a maintainer should really address first (so that everyone else can copy from). For example, how are plugin tests organized? Can they live in each plugin's sub-directory? Can they share a runner? Etc. Etc.
@gr2m Lets spin up a thread to focus only on "how to test plugins", come up with a plan, come up with a few example tests for contributors to use as reference, and then go forward expecting all plugin changes to come with tests.
@FredKSchott I could try an earlier version of the plugin before that change was introduced to verify regression.
I can confirm that downgrading @snowpack/plugin-webpack to version 2.0.4 fixes the problem, so indeed it seems #846 broke it.
@ralphtheninja thank you for confirming!
Are you okay with using version 2.0.4 until we resolve this issue?
It would be helpful if you could try to narrow down the problem further, while we work on replicating the bug with a test for @snowpack/plugin-webpack on our side
@FredKSchott I've added it to the contribution friction thread: https://github.com/pikapkg/snowpack/discussions/958#discussioncomment-72307 I'll try to create a test to @snowpack/plugin-webpack
Are you okay with using version
2.0.4until we resolve this issue?
Absolutely. It bundles the files and environment variables are working, which is the most important thing for me right now. Are there any important updates to the plugin that I'm missing out on? Will get them later after fix anyway.
@FredKSchott I've added it to the contribution friction thread: #958 (comment) I'll try to create a test to
@snowpack/plugin-webpack
@gr2m Feel free to ping me in related issues if you don't mind. I'd like to learn more about snowpack internals.
Most helpful comment
@gr2m Feel free to ping me in related issues if you don't mind. I'd like to learn more about snowpack internals.