Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Idea: Make building "pages" vs "libraries" clever #396

Open
xaviervia opened this issue Aug 12, 2017 · 3 comments
Open

Idea: Make building "pages" vs "libraries" clever #396

xaviervia opened this issue Aug 12, 2017 · 3 comments

Comments

@xaviervia
Copy link
Member

A page is really just a .js file that happens to have an .html file with the exact same name and path. Any file in such situation could be automatically an entrypoint.

That way, there would be no need for pages configuration any more: when starting up, Sagui would read the file tree within src and whenever a .js file is found with a matching .html file, it will build a page.

Building libraries still requires configuration for UMD, so the libraries configuration option can be kept.

@pirelenito
Copy link
Member

Sounds good, but what happens if the user defines a pages config. Then we enforce it instead?

@xaviervia
Copy link
Member Author

I think that's an option, for backwards compatibility.

The other option is to ignore it. I think that is also a valid option: existing users will have an .html file for every page anyway, since it is required by Sagui. If there is an .html file in the src folder without a corresponding .js file, Sagui could just serve that .html file. I don’t imagine this creating any issues, on the contrary.

@xaviervia
Copy link
Member Author

If we deprecate it, when Sagui finds a pages entry in the config it could log a note "pages config is no longer required, pages are now detected automatically from .html files"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants