Conversation
Merged
| ] | ||
| }, | ||
| "build:dev": { | ||
| "command": "eleventy --config=eleventy.config.dev.cjs", |
Collaborator
There was a problem hiding this comment.
should this have a dependency on ../client:build:dev?
Contributor
Author
There was a problem hiding this comment.
No, because otherwise every time the client code changes, Eleventy will re-run unnecessarily, because in dev mode that's just a symlink.
Collaborator
There was a problem hiding this comment.
Hmm... seems like that leaves a situation where the client output could be stale. Is there a different type of dependency at play here. Like: when you run task A, ensure B is up to date, but when you run B, do not dirty A.
Contributor
Author
There was a problem hiding this comment.
Yeah, that's what google/wireit#238 would be -- but I got a lot of feedback that the API and naming is weird, so I've been sitting on that for ages. Maybe need to get back to it.
justinfagnani
approved these changes
Sep 26, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note to reviewers: I first used tsc + Rollup in this PR, and then replaced it with esbuild, so you'll see those commits in the middle. You can ignore them, or read them if you're interested.
Sets up separate dev and prod eleventy builds for the new webcomponents.org. Both builds use esbuild.
Running
npm run watch:devornpm run watch:prodfrom the top-level will give you live refresh versions of either build.The dev build is super fast because [1] it uses symlinks so that Eleventy doesn't need to rebuild when static assets or JS changes, and [2] it runs esbuild with no minification or bundling.
There is a separate
check:typescommand in theclientpackage which runs TypeScript innoEmitmode. This runs in parallel when you use either of the top-levelwatch:*commands. So the experience is that the browser updates immediately, and a few moments later you also get any type errors.This design lets us use identical
<script>tags in both dev and prod mode, which is nice. On lit.dev we needed to generate different script tags for each mode.Also addresses the post-merge comments from #1333