安装可直接在浏览器中运行npm依赖项,无需Browserify,Webpack或导入maps
安装可直接在浏览器中运行npm依赖项,无需Browserify,Webpack或导入maps FredKSchott released this
Fixes and improvements
- 9a9c3ac - docs: update tailwind import path (#1205) @stefanfrede
- 04bed2b - snowpack: partition the build cache (#1195)
- a4ef47c - snowpack: support dev streaming logs (#1203)
- 2b3670f - snowpack: add cli flag support for "experiments.ssr" (--ssr)
- d03cb5c - esinstall: handle cjs auto-named-exports with deep reexports (#1194)
- 710262d - esinstall: move trivial warnings to debug (#1193)
- d86e495 - [plugin-typescript] New plugin! (#1211)
- f515365 - [plugin-svelte] simplify svelte plugin (#1221) @Rich-Harris
- d4b21d3 - [plugin-webpack] Use default name behavior. (#1215) @heikkilamarko
- f61a703 - [template-svelte] remove outdated babel config file
- 3ab3842 - [template-svelte] update svelte templates to match react, preact
Assets
2
FredKSchott released this
Note: v2.13.0 was skipped. v2.13.1 is the first official v2.13 release!
Introducing Snowpack v2.13 - The DX Update. This entire release focused on developer quality-of-life with new features to simplify config, update error logging, and remove all unnecessary friction from your dev environment. It's genuinely one of my favorite releases so far, so I hope you enjoy an even better dev experience with Snowpack.
-- @FredKSchott
Simplified CSA Templates + Fast Refresh Improvements
All of our Create Snowpack App (CSA) templates have been improved this week, but the React & Preact templates got the biggest upgrades. They both sport a new design with a basic counter, perfect for testing that Fast Refresh is working (change the file, and see that the counter doesn't lose state). Behind the scenes, both Fast Refresh plugins have been updated to no longer require Babel externally, which means you can take advantage of our faster, built-in esbuild-powered pipeline.
- 55bbc83 - add example usage of fast refresh to react/preact templates (#1188)
- d69dbfe - refactor react-refresh plugin, babel user-dependency no longer needed (#1178)
- 2f19fd0 - update to latest prefresh/snowpack plugin
- 54fadca - CSA - move config back into templates, out of app-scripts-* packages (#1137)
Automatic "New Dependency" Handling
Tired of having to use that dumb --reload
flag? We were too! Snowpack now automatically re-installs dependencies when a new import is added. This feature keeps your work flowing with fewer unnecessary interruptions.
Automatic CJS "namedExport" Detection
Node.js recently announced that they were attempting automatic CJS<>ESM named export interop. Not to be outdone, we announced that we'd do the same :) This feature means no more manual namedExport
entries needed for most packages. Instead, Snowpack will attempt to automatically scan CJS packages for exports.
Snowpack uses the exact same internal lexer as Node.js to implement this, so expect to see the same results as Node.js v14 when you import a CJS npm package in ESM. However, this is a new idea that may still have some rough edges. If you see mixed results, remember that you can still use a manual "namedExports" config entry to use our more powerful runtime CJS detection.
Logging/Debugging Improvements
Snowpack v2.12 added our first ever Error Overlays. Snowpack v2.13 improves on that work with a full suite of improvements to logging, log formatting, and making sure that all reported errors contain relevant info. Our favorite subtle-but-great feature: Multiple "File Changed..." logs in a row are now counted and collapsed, giving you a cleaner dev console overall.
- 93e3478 - reduce verbose file changed events in the logs (#1190)
- f2279c8 - cleanup hmr error logging
- a809fcc - improve error handing (#1180)
- e59ae05 - add default favicon to dev server, if none exists (#1177)
Better Sourcemap Support
No matter what I try to do to stop you, y'all keep improving our source map support! This release featured work by @pkaminski to add compose multiple source maps together, allowing for source maps in multi-step build pipelines. We have more improvements to add inside of Snowpack to really tighten this story up, but this is a huge step in the right direction
Assets
2
FredKSchott released this
Note: v2.12.0 was skipped. v2.12.1 is the first official v2.12 release!
🆕
Live Error Overlays
Snowpack v2.12 now includes Live Error Overlays to surface build & runtime errors immediately during development. No more searching around for what exactly went wrong. Instead, you'll see every problem surfaced right in the application itself.
To see the new error overlays, just upgrade Snowpack in your project and run snowpack dev
!
A huge thanks to the Next.js team for the beautiful “react-dev-overlay” package template that these overlays are based on!
- Twitter sneak preview from last week: https://twitter.com/pikapkg/status/1308099900538679297
- e373499 - add runtime error overlay reporting (#1142)
- 6ed5359 - Advanced HMR Error Handling (2 of 2: Error Overlay) (#1073)
New Vue 3.0 templates (incl. TypeScript!)
Vue 3.0 was released last week! To celebrate, we updated our Vue + Snowpack template to the latest version AND launched a new template for building Vue sites with TypeScript. Run create-snowpack-app
with the new @snowpack/app-template-vue-typescript
template to see it in action.
- 2a94ff1 - Feature/app-template-vue-typescript (#1088) @Akimyou
- 3a7b097 - updating to vue 3.0.0 @melissamcewen
- 4329d56 - remove bad vue template compiler option (#1101) @coolzjy
A new look for the docs site!
Exploring SSR
We've been exploring a better Server-Side Rendering (SSR) support story for Snowpack (in collaboration with members of the Svelte community) and this release marks the first features & improvements merged into Snowpack for SSR!
This is still an experimental area for us, but it's one we're really excited about investing in. More to come over the next several releases!
Want to get involved? Join us on Discord!
- eba63e3 - Fixes #970 by adding middleware dev config option. (#1062) @joshwilsonvu
- 05b2a9e - Add experimental SSR support for the dev server (#1086) @FredKSchott
A ton of other bug fixes and improvements!
- 95857f0 - [esinstall] add dts package handling (#1133) @FredKSchott
- 20388e4 - [esinstall] enable native esm for node v12+ (#1093) @FredKSchott
- af3c6c5 - [plugin-svelte] fix the dev option for dependencies (#1134) @FredKSchott
- 9891763 - [plugin-webpack] fix unnamed import scanning @FredKSchott
- f2dad02 - [plugin-react-refresh] add plugin error message if setup script not run (#1123) @FredKSchott
- 439d3f4 - [csa:app-scripts-react] add back react typescript support (#1071) @FredKSchott
- 42e48f3 - [csa:app-scripts-preact] add new babel plugin to enable context HMR (#1080) @JoviDeCroock
- 5056a69 - configure hmr port @MoonBall
- 884e4ab - configure run jobs to run in watch mode on build --watch (#1091) @FredKSchott
- 636443d - rethrow error of transform phase (#1095) @MoonBall
- 21610bc - Ensure that the import resolver respects installOptions.externalPackage. (#1070) @pkaminski
- 11c0eb5 - Add live reload delay (#998) @jaredramirez
- 9b7ad5c - Add .avif format to static types (#1066) @stramel
Assets
2
FredKSchott released this
New optimized build plugin: @snowpack/plugin-optimize
Thanks to @drwpow for spearheading this work.
HMR/Livereload enabled for build --watch
mode
@MoonBall led this project (#1008) from start to finish
Assorted fixes and improvements!
- 0c5390d - feat(plugin-vue): Improve TS, JSX support (#984) @Akimyou
- fa4190d - feat(plugin-webpack): implement html minifier (#1015) @stefanfrede
- 3564ee5 - fix(plugin-webpack): allow omitting options (#1047) @ralphtheninja
- 2926370 - fix: Inline process.env variable references directly when installing. (#1044) @pkaminski
- 1667143 - fix: Windows process exit properly. (#1022) @pkaminski
- 936b524 - fix: casing of module locations to match that used by Rollup. (#999) @pkaminski
A huge thanks to all of our contributors for this release!
Assets
2
FredKSchott released this
Bug fixes and more!
- 2966ec4 - fix css import url resolver (#1001)
- 549caa2 - remove source mapping url
- 263c2b1 - Remove the process polyfill's dependency on window, so it can run in web workers. (#994)
- 27ce2db - fix greedy css import regex (#991)
- 5df8c55 - Fix HTML_JS_REGEX (#986)
- ac04f91
@snowpack/app-scripts-preact
- update @prefresh/snowpack dep - 2be375a
@snowpack/plugin-webpack
- add manifest to webpack plugin (#983)
Assets
2
FredKSchott released this
Some "build" command fixes
Assets
2
🆕
Native CSS @import
s
Snowpack now supports automatic scanning and resolution of your native CSS @import
statements. Use it to load CSS, Sass, Less, and any compile-to-CSS language you already have defined in your build pipeline. We even support npm package imports.
See our documentation for more info: https://www.snowpack.dev/#css-imports-(%40import)
Learn more about CSS @import
syntax: https://developer.mozilla.org/en-US/docs/Web/CSS/@import
Other Fixes and Improvements
- 43cf5ce - fix: handle comments in import specifiers (#594
- b112148 - fix: handle plugin buffer response (#950)
- d484739 - fix: tree shaking package when imports include file extensions (#972) @MoonBall
- 0398fc3 - fix: support
snowpack.config.cjs
config files, fortype: module
projects (#968) @lewisl9029 - 5372aab - fix: %PUBLIC_URL% replacement in dev server (#957)
- de040f2 - fix: exit process after success (#956) @lukeed
- 2905af5 - fix: console logger methods log all arguments passed (#951)
- 75b23c3 - fix: proxy file when dev (#940) @MoonBall
- 843cf9e - code cleanup (#949) @MoonBall
New Logos!
CircleHD (@circlehddev) & Tongdun added to our "Who's using Snowpack" section!
Assets
2
FredKSchott released this
Assets
2
FredKSchott released this
🎊
Bug Fixes & Improvements Galore!
- Improve module resolution error messages (#929) <@silverwind>
- fix: wrong proxy path of package assets (#933) <@MoonBall>
- fix: typo (#935) <@chenxsan>
- fix: bad baseUrl normalization (#919) <@FredKSchott>
- fix: full process object polyfill <@MoonBall>
- fix: quick alias code cleanup (#914) <@FredKSchott>
- fix: partial request responses (#794) <@stramel>
- fix: alias match function (#890) <@MoonBall>
- fix: encoding (#882)
- fix: no web_modules proxy file (#906) <@MoonBall>
- fix: open tab twice when
openChrome
occurs error (#894) <@MoonBall> - fix: namedExport of react-dom/server.js (#885) <@MoonBall>
- remove: outdated, legacy web_modules path handling (#917) <@FredKSchott>
- feat: replace
%SNOWPACK_PUBLIC_*%
and%MODE%
environment variables in HTML (#900) <@gr2m> - fix: ignore
SNOWPACK_PUBLIC_
env variable when generating__snowpack__/env.js
(#924) <@gr2m> - Documentation improvements on www.snowpack.dev
Assets
2
FredKSchott released this
A huge thanks to all of our contributors who made this release possible, including:
- @Akimyou, who fixed tricky issues in our HMR server
- @fubhy, who improved our
process
polyfilling logic - and @MoonBall, who made several improvements across our plugin ecosystem, including a new
config()
hook!
See "Improvements / Bugfixes" below for a full list of relevant changes in this release:
⭐
NEW: Parallelized Builds
#808 - The build command now runs multiple builds in parallel, one job for every core available on your machine. Snowpack build plugins can take advantage of this new support by offloading computationally consuming work to child processes, allowing Node.js to parallelize the work. Several of our plugins already support this:
@snowpack/plugin-build-script
: Builds each file by running a CLI command in a separate thread.@snowpack/plugin-babel
: Spins up a pool of workers to run multiple Babel builds in parallel.esbuild
: Our default JSX/TypeScript builder is built with Go, and supports parallel builds.
The result? ~2x faster builds when parallel-enabled plugins are used. If your plugins are not yet built to take advantage of this feature, there should be no impact on performance.
⭐
NEW: Snowpack + Pika Discord Community
🐛
All Improvements & Bugfixes
dev
d9a6623 fix remote import url handlingdev
c5490fd Improve HMR (#827)dev
07e4728 fix install error log to be more helpfuldev
6950266 support the html extension in dev server (#870)build
582d0ed Support treeshaking when importing React by namespace (#879)build
ee05c28 ignore build directory in default build (#874)install
dde6a77 feat: add rollup plugin for polyfilling the global process object (#854)plugins
5b0fe76 add config() hook (#864)plugins
42493b6 update transform plugin to use id instead of filepath (#837)plugins:webpack
17e93b6 Webpack: fix wrong logic when extendConfig's plugin has options. (#842)create-snowpack-app:svelte
149515f Svelte: fix tsconfig for svelte templatecreate-snowpack-app:preact
c9f3886 Preact: bump prefresh version
Assets
2
⭐
New
snowpack build --watch
mode: have snowpack build to disk on every file change. Great if you are running your own server, such as Rails (#782).@snowpack/plugin-vue
has a new error output (#809). Give it a try!- The
app-template-react
template now comes preloaded with React refresh! (#829)
🐛
Improvements / Bugfixes
- Dev server swallowing console logs has been fixed (#762, #807, #809). Also as a bonus, we dropped
ora
as a dependency, lightening the build a little and improving Windows output. - CommonJS support has been improved (#783)
- Many module resolution & alias fixes for more stable development (#777, #554, #789, #796)
Assets
2
Fix
Assets
2
FredKSchott released this
Assets
2
FredKSchott released this
Export Map Support (#539)
Snowpack now supports export maps! As of Node v12 (LTS) package authors have the chance to define an explicit set of file entrypoints inside of their package. Snowpack will now respect these export maps, and warn if you try to import a file outside of them. `import 'preact/some-private-package-file.js' will now throw an error to match Node.js behavior.
See Node's official documentation for more: https://nodejs.org/api/esm.html#esm_package_entry_points
Optimized Build Dependencies (#526)
As a part of your production build, Snowpack now scans your build output to optimize your dependencies. Previously, Snowpack would tree-shake by scanning your source code, which gave less accurate results. This new feature gives you an even better-optimized tree-shaking result, and fixes issues where your build pipeline actually adds/removes imports.
Other Features & Fixes
- @snowpack/plugin-webpack v1.4.0 released with logging and polyfill improvements.
- Enable livereload when HMR is not supported for the file type (ex: HTML file change) (#540) f29b9fe
- Fix: Fallback to HTTP1 when using proxies (#536) 5653cdf
- Fix: Allow baseUrl to be remote (#531) 5e6fc22
- Fix: Resolve JS imports inside of HTML script tags (#527) 641cc81
- Fix: Import a folder with trailing slash on the path (#529) 55fb04c
- Fix (
externalPackage
): now matches deep imports within an external package (#533) f60ae3d - (Internal, use at your own risk!)
import {unstable_installCommand} from 'snowpack';
(#525) d203b02 - (Internal only) Add standard file interface (#541) b538d68
- (Internal only) Swap Chalk for Kleur (#520) e7d67ff
PS: Our webpack plugin
v2.5.4...v2.6.0
Assets
2
FredKSchott released this
Small Regression Fix
Assets
2
Fixes and Improvements!
- Expose JS install function (
unstable_Install
) (#518) 22b4362 - support type-only packages (#521) a863c8f
- improve resolve logic for folders (#515, #519)
- Fix warning message bug (#512) ab78391
- Remove outdated homepage from Snowpack config (#511) df3a7e4
- Adds secure option to the devOptions 1e1472b
- Update src-file-extension-mapping.ts fb9b672
- Collection of small fixes (#499) 6b1eba6
- Update docs
Assets
2
Assets
2
FredKSchott released this
Add HTTPS/HTTP2 server (#422) 3266d9b
Snowpack now supports the snowpack dev --secure
flag, which will run your dev server via HTTP2. This is much faster than HTTP/1.1 for unbundled applications like Snowpack's dev app.
HTTP/2 is powered by HTTPS, which requires a bit of additional setup for your dev environment to work properly. On your first run of Snowpack with the --secure
flag, you'll be shown instructions to generate credentials to use for HTTPS.
Small Fixes & Improvements
- Add support for devOptions.hmr (#427) c489384
- Fix treeshaking bug 72933b3
- Fix issue with babel macro matching 78a27ff
- Fix node polyfill plugin bug a29339a
- Improve node polyfill error handling 171ae8e
- Fix readline capture issue with simple stdin listener 546c94e
- Fix HMR support for CSS modules (#438) 4ebb6c8
- Fix install scanner to scan html files for JS deps as well 1727f88
- Fix react-table esm workaround 6742556
- Fix .svx usage 07b0fb1
Assets
2
FredKSchott released this
Fixes
Assets
2
FredKSchott released this
Lots of new features in this release! Big thanks to @stramel and @stellarhoof for their contributions of these much-requested features.
Project-Level Imports
- Top-level imports based off of mount directories (#397) cd69328
- Learn more: https://www.snowpack.dev/#project-relative-imports
Advanced Proxy Configuration
- Add proxy config options (#393) c8325ca
- Learn more: https://www.snowpack.dev/#dev-request-proxy
ENV Variable Support: import.meta.env
- Add basic env variable support (#394) 43969d0
- Learn more: https://www.snowpack.dev/#environment-variables
Also:
Assets
2
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.
Fixes & Smaller Improvements
Assets
2
FredKSchott released this
dev
fix issue with web_modules loading af783e6
Assets
2
FredKSchott released this
** Psst... Save the date! Snowpack 2.0.0 is coming May 26th!**
🎉
Snowpack 2.0.0-RC.1
Thank you everyone who tried out the Snowpack v2.0 Beta! Thanks to you, we've been able to hone in on the final feature set & API for Snowpack v2. At this point we're feeling confident enough to tag our first release candidate (with an official 2.0.0 release scheduled for next week)!
We don't expect any big API changes going forward, so If you want to test Snowpack v2.0 readiness for your application (or framework/library, if you're an open source maintainer) there's never been a better time to start!
What's new?
Snowpack v2 was announced the other week as a next step for the bundle-free development movement that we'd helped kickstart back during the Snowpack v1.0 release. You can read our full announcement thread & story here.
Since that announcement, we've finalized our v2.0 feature set with a bunch of new features requested by you: Hot Module Replacement (HMR), built-in JSX/TS/TSX handling via esbuild, CSS/JSON/Asset imports, and an entire 3rd party plugin system for extending Snowpack are all now available.
We'll be teasing these new features & plugins over the next week, so follow us on Twitter to get an early preview of what's new as we get closer to next week's release. Until then we'll be working on documentation, code cleanup, and testing to prepare for a stable & solid release.
Learn more: https://snowpack.dev/
Create your first plugin: https://snowpack.dev/plugins (These docs are still very much in progress)
Get updates: https://twitter.com/pikapkg
Assets
2
FredKSchott released this
- Fix:
"'import' and 'export' may only appear at the top level" error in ...
- Pinned Rollup commonjs plugin to earlier version to workaround
- See rollup/plugins#304
Assets
2
FredKSchott released this
You can read the full release notes below. But first, a look ahead...
The Road to Snowpack v2.0
As it stands, v1.7 is our last planned v1.x release before v2.0.
The project has grown a ton over since our v1.0 release: 160+ PRs, 50+ contributors, and a collection of podcasts, blog posts, video tutorials and more. I'm overjoyed that this project has meant so much to so many. If you're reading this, thank you.
We've also learned a ton from you in the process: what works, what doesn't, and what's still confusing. It turns out, there's still a lot to get confused about. This will be our focus for v2.0: The fastest dev environment on the web should also be the easiest to use.
- Remove our npm coupling: Configuring Snowpack to re-run every npm install/uninstall/add/remove can be a pain. That's why Snowpack v2.0 will also be able to install and manage dependencies independently from npm/yarn. Learn more...
- No more React workarounds: By letting Snowpack fully manage & install your
web_modules/
directory, we can make sure that every package installs correctly from the start. No more workarounds needed for React and others! - A better dev environment: Today, Snowpack works with your favorite static dev server. This is an important goal for the project, but it's also a lot to ask a new user to set up. Starting in v2.0, Snowpack will ship a
dev
command that gives you a fully-configured dev environment, instantly. Learn more... - Better defaults: We've kept around a lot of v1.0 behavior to prevent breaking changes, but new features launched since then make more sense as defaults. v2.0 will be a chance to enable some of our favorite features from v1.x (like
--stat
mode) by default.
If you're interested in getting involved and helping out, this is a great time to do so! We keep our Issue tracker extremely clean so that you can always find an issue that we're looking for help on.
v1.7.0 Release Notes
--env
process.env support (author: @postspectacular)
Snowpack's process.env
handling has gotten an upgrade and a new feature: you can now rewrite custom process.env properties in your dependencies via --env
/"env"
config support. This is essential if you find yourself working with a dependency that checks for a custom property like "process.env.MY_CUSTOM_KEY" that you'd like to provide.
A better babel plugin (author: @francislavoie)
Based on your user feedback, we've completely updated our Babel plugin to better support complex project layouts. It now supports:
- webModulesUrl - Rewrite your bare module imports to an absolute path (
/web_modules/...
), a relative path (../web_modules/...
), or even an absolute, remote URL (https://static.yourdomain.com/web_modules/...
). - moduleResolution - Resolve relative imports using Node's resolution logic. Instead of just adding missing extensions, we'll now also resolve directory imports (
/foo
->/foo/index.js
).
JSX & TypeScript support for --include
(author: @dangodev, @FredKSchott)
Our previous import scanner left TypeScript users, JSX users, and others stuck in a Catch-22: scanning your compiled code for new dependencies required a successful build, but creating a successful build required that new dependencies were already installed.
You can now use --include src/**/*
to scan your actual source for the correct dependencies, even if you're using non-standard language features like TypeScript or JSX.
Other Bug Fixes
Assets
2
- Small fix to handle Node v13.10's new "ERR_PACKAGE_PATH_NOT_EXPORTED" error type 72d1bd4
Assets
2
Assets
2
🆕
Custom install plugins (via Rollup)
You might encounter non-JS npm packages that can only run with additional parsing/processing. Svelte packages, for example, commonly include .svelte
files that will require additional tooling to parse and install for the browser.
In these rare cases, you can now add custom Rollup plugins to your Snowpack config to handle these special files:
// snowpack.config.js
module.exports = {
rollup: {
plugins: [require('rollup-plugin-svelte')()]
}
};
Thanks to @dangodev for identifying the problem, proposing the solution, and implementing the PR.
Other fixes and improvements
Assets
2
FredKSchott released this
Note: This is an important update for Node v13 users that adds support for export maps, a new feature that some packages are beginning to adopt. For node <=v12, this update is encouraged but not required.
Thanks to collaborators @dangodev & @Monchi for their help with this release!
Notable Changes
- Add export map support for node v13 (#193) eae89aa
- Allow importing of packages not explicitly mentioned in package.json (#192) f825df7
- Fix pika-treeshake on Windows (#178) 2ce922d
- Change babel plugin to use import map as its source of truth (#189) 090ac06
- update react error message (#188) 47f9b97
- update deps 72b9d09
- Update docs
Assets
2
FredKSchott released this
- Redo the dedupe fix from v1.1.3, which didn't catch all errors 2db3ca0
Assets
2
Important Fix
- Fix a "dedupe" regression in our internal Rollup engine (#186) b29c0c6
- Unless you're using a package-lock/yarn.lock, you'll need to update Snowpack to fix an issue with how we pass our dedupe config property to our internal Rollup engine
- updated docs
Assets
2
FredKSchott released this
NEW: --nomodule Support
- Tweet announcement: To be linked...
- New Section - Legacy Browser Support: https://www.snowpack.dev/#legacy-browser-support
- New Section -
--nomodule
: https://www.snowpack.dev/#supporting-legacy-browsers - Shout out to @dangodev for the work on this feature!
Other changes
Assets
2
FredKSchott released this
Assets
2
FredKSchott released this
- update docs
- Fixed 'missing package.json' error message #143 (@AyoAlfonso)
- Updated deprecated rollup imports
Assets
2
FredKSchott released this
Patch fixes:
- Fix support for
dat.gui
package - add support for --include scanning bare module specifiers #138
- Update deps
- Update docs (with new Guides!)
- New examples
Assets
2
FredKSchott released this
Major Change: Rename!
Major Change: Tree-shaking!
A HUGE thanks to @dangodev for this feature. When Snowpack is run with the --optimize
flag it is able to analyze your application source code to detect exactly which dependency exports are used in your application. Anything unused is removed from the optimized dependency installation.
Major Change: --include
(Automatic import detection)
Another great contribution from @dangodev. Tree-shaking wouldn't have been possible without the ability to detect your application imports automatically. Even without the tree-shaking component, being able to automatically detect which dependencies are needed gets rid of a ton of configuration in old versions.
Major Change: A new docs site!
Minor Changes
- Added UC Browser to default "browserlist" ignore string. UC Browser doesn't support ESM (yet) so this may result in a better-optimized default env target for
--optimize
.
I'll be promoting this more tomorrow (on Twitter, etc) and cleaning up the docs site tonight, but I wanted to get the actual release out there asap for anyone who wanted to try it out. Thanks for all your hard work everyone!
Assets
2
FredKSchott released this
v0.6.0 was accidentally broken on publish, v0.6.1 is the next release after v0.5.3
New Features
- (Experimental) Non-JS static asset support! This support actually went out with v0.5.2, but with v0.6.0 we'll start to talk about it more. Please leave feedback on both config and developer experience!
- Monorepo support! Use @pika/web in a monorepo where dependencies may live a level or two above the current working directory.
- Babel as a production optimize step: In v0.5.0 we introduced running your deps through Babel. In v0.6.0 we've scaled that back to only run with the
--optimize
flag or the new explicit--babel
flag. We recommend usingpika install
normally, and then runningpika install --optimize
before pushing to production.
Assets
2
FredKSchott released this
Assets
2
FredKSchott released this
- Small fix to incorrect repository URL 7ea605a
Assets
2
Patches & Fixes:
- Fix an issue where any non-ESM package could fail your entire installation.
- Made output more clear about which dependencies were converted and which were not.
NEW: When used with an install whitelist:
NEW: When used without an install whitelist:
Assets
2
FredKSchott released this
Thanks to the hard work of our new contributor @Birch-san, we now have Deep Package Support (aka installing specific files from within a package)! See this new code snippet in the README:
"dependencies": { "htm": "^1.0.0", "preact": "^8.0.0", /* ... */ },
"@pika/web": {
"webDependencies": [
"htm",
"preact",
"preact/hooks", // A package within a package
"unistore/full/preact.es.js" // An ESM file within a package
]
},
This does involve a small breaking change for anyone who was using a scoped package: We had previously reformatted scoped package names to replace the /
with --
. This gave us a flat web_modules
directory, but the feedback was almost universally "wtf why?". In v0.4.0, scoped package names are now installed untouched:
preact -> web_modules/preact.js
-@pika/fetch -> web_modules/@pika--fetch.js
+@pika/fetch -> web_modules/@pika/fetch.js
preact/hooks -> web_modules/preact/hooks.js
unistore/full/preact.es.js -> web_modules/unistore/full/preact.es.js
Finally, another big thanks to @Birch-san for his thoughtful work on this release along with anyone who contributed the Issues, PRs, or our new Spectrum community.
Assets
2
FredKSchott released this
- Whoops, fix package.json error
Assets
2
Watchers:157 |
Star:17346 |
Fork:802 |
创建时间: 2019-02-26 23:45:38 |
最后Commits: 4天前 |
许可协议:MIT |
02bfdd0
Compare
New App Template: Preact + TypeScript
New Official Plugin: Sass
Add Svelte "Fast Reload"
Bug fixes and other improvements
this
value (#1219) @fubhy