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

Add option for bundle file name #145

Open
ryyppy opened this issue Dec 2, 2018 · 8 comments
Open

Add option for bundle file name #145

ryyppy opened this issue Dec 2, 2018 · 8 comments

Comments

@ryyppy
Copy link

ryyppy commented Dec 2, 2018

I would like to be able to run fastpack multiple times, with different entry points and output each bundled file with a different filename in the same output folder.

it seems there is no option to give it a different name and it will always create the bundle as index.js.

Would you be interested to support a flag for this? Not sure about the flag name, but I would be happy to do a PR.

@TrySound
Copy link
Member

TrySound commented Dec 2, 2018

#80

@zindel
Copy link
Member

zindel commented Dec 3, 2018

@ryyppy -n or --name is already added :)

@ryyppy
Copy link
Author

ryyppy commented Dec 3, 2018

hm weird, seems to be undocumented then... will try that, thanks!

@gilbert
Copy link
Contributor

gilbert commented Dec 3, 2018

It's documented in the readme. Is it missing in the executable --help section?

@zindel
Copy link
Member

zindel commented Dec 4, 2018

@gilbert in fact, the readme is a copy/paste of the --help, so it should be there as well

@ryyppy
Copy link
Author

ryyppy commented Dec 6, 2018

@gilbert @zindel aha, i see it in the README, but it's apparently missing on the website 😄

@Schmavery
Copy link

I was just trying to use this new flag as mentioned in this issue, multiple times, with different entry points and output each bundled file with a different filename in the same output folder.
On my machine (with version 0.8.4 (Commit: 365123f)), every run of fpack seems to delete everything else in the folder, so this workflow isn't working for me. Is that intended behavior?

@zindel
Copy link
Member

zindel commented May 7, 2019

@Schmavery yes, this is the intended behaviour - fastpack "owns" the output directory. The reason for it is that there may be (and likely will be) more files named internally by the fastpack (css, static assets, JS chunks), so we need a way to guarantee that the output is consistent with the latest state of the source code. -n option is added to provide the public API to the output - i.e. you can refer the bundle from the HTML file.

Could you give a little more details on your workflow where this strategy fails?

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

5 participants