-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Feature Request: Add 'open' as an option. #28
Comments
Incase anyone else comes here looking, here is an equally hacky workaround: // .eleventy.comfig.js
const PORT = 8100 // use a port you are reasonably sure is not in use elsewhere
module.exports = (eleventyConfig) => {
eleventyConfig.on('eleventy.after', async () => {
// Run me after the build ends
require('out-url').open(`http://localhost:${PORT}`);
});
eleventyConfig.setServerOptions({
port: PORT,
}) It will re-open the browser if you update your config file but it's something. |
@dwkns Also kinda hacky and requires the In package.json
So at terminal |
Additionally, it might be nice to be able to configure what browser is opened. Perhaps a value of It might also be good to let the browser be selected by an environment variable like For context, I like to use Polypane for development, but I don’t have it set as my default browser. |
Just upgraded to 11ty 2.0 and was really surprised to see this missing. Hope to see official support soon! |
This would be a great addition. I vote |
The previous BrowserSync dev server had an
open: true
option that would open the browser window when the server started.Would be nice to have that added back in. This horrible hack (nearly) works:
and
But adds a dependency and if you change the
open
option fromtrue
tofalse
in.eleventy.js
while the server is running it opens the browser again. I'm sure there is a much better way to do this.The text was updated successfully, but these errors were encountered: