-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webpack watch tarballs #86
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please restore watch-and-repack.sh? I've found it extremely useful for my workflow, and there's detailed instructions around using it. this can be an additional way to do local dev and keeping it doesn't hurt
let's also move it to the scripts folder so it's not in the root
af33dd1
to
ea3e642
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed offline that script properly propagates changes.
general curiosity, what prevents it from falling into an infinite loop? when I simulated hmr with fswatch
, it initially continuously triggered the repack process because the repack itself was causing changes that fswatch picked up, leading to an infinite loop.
@@ -147,10 +190,11 @@ const config: webpack.Configuration = { | |||
filename: 'offscreen.html', | |||
chunks: ['offscreen-handler'], | |||
}), | |||
// watch tarballs for changes | |||
WEBPACK_WATCH && new WatchExternalFilesPlugin({ files: localPackages }), | |||
WEBPACK_WATCH && PnpmInstallPlugin, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was aware of built-in dev hot module reloading config for webpack (https://webpack.js.org/configuration/watch/), but wasn't aware of the various watch options (https://webpack.js.org/configuration/watch/).
You may have been |
@@ -2,6 +2,7 @@ import { defineConfig } from 'vite'; | |||
import react from '@vitejs/plugin-react-swc'; | |||
|
|||
export default defineConfig({ | |||
clearScreen: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this prevents the marketing site vite build from blanking the terminal, so extension build output remains visible when running dev
from the repository root
@@ -24,7 +23,7 @@ | |||
"noUnusedParameters": true, | |||
"resolveJsonModule": true, | |||
"target": "ESNext", | |||
"module": "ES2022" | |||
"module": "preserve" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the implications of this new module config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are zero implications because no packages are published from this repo. but due to several idiosyncratic configurations and webpack's lack of true support for typescript config, the previous module resolution prevented the import of the package json data in webpack config, and this resolution mode is more permissive.
improves local tarball workflow.
run
in this repository to use local tarballs, and automatically reload changes when those tarballs update.