Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Add configuration option for source location #251

Closed
xortive opened this issue Jun 14, 2019 · 2 comments
Closed

Add configuration option for source location #251

xortive opened this issue Jun 14, 2019 · 2 comments

Comments

@xortive
Copy link
Contributor

xortive commented Jun 14, 2019

This is a blocker for implementing live reloading that doesn't require user configuration. With wrangler supporting multi language builds, doing a webpack style traversal from the entry point is needlessly complex, when moving all source files into one directory and watching that recursively is a much easier problem.

we could use src or worker as a default (probably combine this with #206). As long as all of your source files are in this , the rest of your directory tree is irrelevant as we will recursively check the source directory for changes.

@xtuc
Copy link
Member

xtuc commented Jun 14, 2019

I don't like your proposal because I don't want to assume the user's source directory. We should check how webpack does it exactly.

Related to #235.

Also worker is not a source directory currently; #206.

@xortive xortive changed the title Add source directory Add configuration option for source location Jun 14, 2019
@xortive
Copy link
Contributor Author

xortive commented Jun 14, 2019

Webpack traverses imports/requires (looking in whatever you have set your resolve locations to) starting from the entry point, and also has an option to set paths/files to ignore.

I don't think reimplementing this is something we should do, but we could potentially change wranglerjs to not do dist-to-clean cleanup on livereloads and run webpack in watch mode and monitor the output of it. However, with projects that use webpack as well as rust/wasm this means they would have two places to configure hot reloading (webpack config, and wrangler.toml)

Cargo by default puts all source in <project-root>/src but this can be configured.

Ideally the solution we adopt supports all current project types, as well as any custom things in the future. I'm thinking we allow a config option that lets you specify file paths as well as source directories which will be searched recursively, and an ignore option that functions just like .gitignore rules do (we could even add an option to look at gitignore, reusing the ignore crate that ripgrep created)

@xortive xortive closed this as completed Jun 20, 2019
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