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

feat: accept function as publicPath option #51

Merged
merged 3 commits into from
Nov 26, 2018
Merged

Conversation

ipsips
Copy link
Contributor

@ipsips ipsips commented Nov 22, 2018

Allow publicPath option to be a function that returns the publicPath string that could be determined based on current context.

In my use case I need to return a relative path with varying depth depending on how deep in dir structure the loaded file is:

publicPath: (context) => '../'.repeat(path.relative(srcPath, context.context).split('/').length)

@ipsips
Copy link
Contributor Author

ipsips commented Nov 23, 2018

@jhnns what are the chances of this getting a review/merge/publish to npm any time soon? jus' hate to depend on my fork in our project :)

@jhnns
Copy link
Member

jhnns commented Nov 23, 2018

Thank you for the PR. Looks good 👍

Could you also add a small explanation to the README?

@ipsips
Copy link
Contributor Author

ipsips commented Nov 23, 2018

certainly. added an explanation and example to Options section in README

@jhnns jhnns merged commit 678933e into peerigon:master Nov 26, 2018
@jhnns
Copy link
Member

jhnns commented Nov 26, 2018

Thx 👍. Published as 3.1.0 🚀

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

Successfully merging this pull request may close these issues.

2 participants