Skip to content
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 --dest CLI option to define the output folder #3

Closed
midudev opened this issue Mar 2, 2019 · 2 comments
Closed

Comments

@midudev
Copy link
Contributor

midudev commented Mar 2, 2019

First of all, awesome work. I love the idea!

Would you consider adding a --dest CLI option in order to define an output folder? While working with it I found I work in my projects with a src folder, so when importing without bundlers and transpilers, the fact that the web_modules is in the root made me to move manually the web_modules inside the src folder in order to ESM imports to work accordingly.

My src/app.js (loaded from an src/index.html) looks like that.

import htm from './web_modules/htm.js'
import {h, render} from './web_modules/preact.js'

Even If we want to perform the pika-web on the bundle process, if the site is static, sometimes we move the src to a public folder and I would like to to the pika-web directly pointing to a dest folder instead having to move manually.

If that do so I would love to work on it (any indication would be appreciated in order to optimize the process to get it merged ;)) and also I will like to know if the web_modules folder is a must or the dest folder would be completely customizable.

Thanks!

@FredKSchott
Copy link
Owner

FredKSchott commented Mar 2, 2019

+1, this is a great feature request. There are only two places where web_modules is hardcoded right now:

https://github.com/pikapkg/web/blob/e56fa8d0268920370875dfd42a6318cdad0b82e2/src/index.ts#L42
^ We delete the web_modules folder before re-writing to it, but honestly I think you can just remove this for now. We will overwrite everything important, and could introduce a --clean option later if users wanted to do a clean install.

https://github.com/pikapkg/web/blob/e56fa8d0268920370875dfd42a6318cdad0b82e2/src/index.ts#L84
^ This should be the only line that needs to be changed, to take the --dest value and join/resolve it with the current working directory to get the full absolute path.

@midudev
Copy link
Contributor Author

midudev commented Mar 3, 2019

Merged!

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

2 participants