Directory Import Resolution - import './routes';
Previously, we'd done a very lazy + '.js'
to any import missing a file extension, which broke if the import was a directory and users were expecting node-style directory resolution to the directory's index.js
file.
Now, we first check if it's a directory, in which case we add a slightly less lazy + '/index.js'
instead.
Faster, Better Import Scanning
Previously, we'd powered our install import scanner with esbuild, which caused any non-standard JS to fail if esbuild didn't support it, blocking users from using Snowpack entirely (err: Parse Error
).
Now, we have a general fallback scanner for any non-JS syntax. This is now an entirely static analysis of your source directory, meaning we were able to remove esbuild entirely. It's very, very fast now.
True http-proxy
Support
Our "proxy" build script was naively just making http
requests to the proxied destination. This work now uses a real proxy server implementation to support more requests, and sets the stage for us to introduce better proxy configuration support for all the http-proxy library options.