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

replacement operation doesn't work as expected #24

Closed
ranitg opened this issue Oct 5, 2021 · 1 comment
Closed

replacement operation doesn't work as expected #24

ranitg opened this issue Oct 5, 2021 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@ranitg
Copy link

ranitg commented Oct 5, 2021

Hi,
I'm trying to use your tool.
The replacement in the html file doesn't work correctly for me.

.buster.json:
{
"options": {
"manifest": true,
"verbose": true
},
"directives": [
"_release/js/libs/require.js:1",
"_release/index_tpl.html:2"
]
}

In index_tpl.html file:

<script type="text/javascript" src="js/libs/require.js"></script>

The replacement does not work.

It works, if I change it to:

<script type="text/javascript" src="_release/js/libs/require.js"></script>

it works only if it's the exact as the directive.

I your example it seems that it should work with .buster.json even though the src is not exactly like in the directive:
release/media//*.jpg:1
release/
/*.html:2

->

Can you help?

@jeffschwartz
Copy link
Collaborator

jeffschwartz commented Oct 5, 2021

Regarding your issue, your script tag src attribute should begin with a forward "/" slash:

<script type="text/javascript" src="/js/libs/require.js"></script>

With the beginning forward slash the url is site relative, without it it is page relative.

Please let me know if this fixes your issue.

@jeffschwartz jeffschwartz self-assigned this Oct 5, 2021
@jeffschwartz jeffschwartz added the question Further information is requested label Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants