Replies: 1 comment 1 reply
-
My current solution is: let bundler = new Parcel({
entries: '.parcel-docs/index.html',
defaultConfig: '@parcel/config-default',
defaultTargetOptions: {
distDir: '.parcel-docs/dist',
},
serveOptions: {
port: 3000,
},
hmrOptions: {
port: 3000,
},
additionalReporters: [
{
packageName: '@parcel/reporter-cli',
resolveFrom: fileURLToPath(import.meta.url)
},
],
});
await bundler.watch();
await open('http://localhost:3000/'); Not sure if it is the best way to do it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have the following JS code to start dev server:
However, I didn't find a way to automatically open browser. Just like
--open
option in CLI mode. Does Parcel support this in JS API? Or should I useopen
package?And how could I keep the same console output in Parcel API like Parcel CLI?
Beta Was this translation helpful? Give feedback.
All reactions