Open NfNitLoop opened 3 years ago
🤦♂️ Ah! It was the file path. Looks like the plugin silently does nothing if the filePath doesn't exist. (That should probably fail a bit more loudly!)
It doesn't seem to like the file format from the docs, though. I get the following error:
[legacy-bundle] SyntaxError: C:\Users\Cody\code\feoblog\web-client\build\ts\naclWorker\worker-nomodule.js: Unexpected keyword 'import' (5:1)
3 | // See: https://www.npmjs.com/package/legacy-bundle-snowpack-plugin
4 |
> 5 | @import worker.js
| ^
6 | @import * as nacl from 'tweetnacl'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
[Update:] Aha, I missed that the file path references the target directory. It worked! This is handy!
The file path issue is still a pain point for anybody new, though. Seems worth keeping this ticket around for that.
Hi, I'll take a look and I could definitely add in better error handling.
This was really more of a proof of concept plugin I made to demonstrate how snowpack could be used to generate production builds. Snowpacks changed a lot since I first made it but it's pretty straightforward and should still work. If you didn't figure out the issue, I can take a closer look.
Hi! I came across your plugin on the snowpack plugin list. It sounds like just what I need -- I need to convert code destined to run in a web worker into a module-free version, since Firefox and Safari don't support modules in web workers yet.
Unfortunately, the plugin seems to do nothing. I've got a file like:
And a config that says:
But I don't see any output from legacy-bundle-snowpack-plugin when I run
snowpack build
, and the version of the file in mybuild/
directory is unchanged.(Note the intentional .jss file misspelling. I get the same behavior w/ the correct or incorrect file path.)