Skip to content

Use webpack instead of javascript #26

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

Open
exvuma opened this issue Oct 21, 2019 · 4 comments
Open

Use webpack instead of javascript #26

exvuma opened this issue Oct 21, 2019 · 4 comments

Comments

@exvuma
Copy link
Contributor

exvuma commented Oct 21, 2019

Have this default template use webpack as a type in wrangler.toml

Then move index.js to ./src/index.js and update package.json?

I am not sure if it will confuse users by now having src, workers-site and worker directories that all contain a worker script though. This probably needs design

@EverlastingBugstopper
Copy link
Contributor

workers-site is not in this template

@exvuma
Copy link
Contributor Author

exvuma commented Oct 21, 2019

workers-site is not in this template

Correct nor worker until build time. We would be adding a new directory concept: src. (which yes seems simple enough but then we have worker-site for site projects) I just think it's confusing that we are defining all these different directories. Also, the other templates just use index.js so it'd be another chore to change all the others.

I am open more opinions though if we think this should be a priority

@EverlastingBugstopper
Copy link
Contributor

yeah. this is just how i structure projects, it gets really messy really quick if you want to start adding more files other than index.js which is why i like a src directory. it's a very common pattern that i dont think people would be confused by and seems separate from the concerns about build directories.

@kristianfreeman
Copy link
Contributor

I also add src as soon as a project gets complex, but just switching to webpack doesn't necessarily mean that we need to add src here, right? afaik our webpack type looks for index.js

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

No branches or pull requests

3 participants