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 to bundle jQuery and bootstrap #95

Closed
kanduvisla opened this issue Oct 18, 2017 · 4 comments
Closed

Add option to bundle jQuery and bootstrap #95

kanduvisla opened this issue Oct 18, 2017 · 4 comments

Comments

@kanduvisla
Copy link

Our build server (Jenkins) has the security policy that it does not allow loading external resources in it's reports. This means that the jQuery and bootstrap JavaScript and CSS files in the template are blocked, rendering the report broken.

Would it be an idea to add a configuration flag that bundles these assets in the reports so that there are no external dependencies required?

@zdenekdrahos
Copy link
Member

zdenekdrahos commented Oct 18, 2017

@kanduvisla: what do you think about assets definition in .phpqa.yml?

report:
    assets:
        # default url -> absolute link <script>...
        bootstrap.js: https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
        # local asset would be copied to `--buildDir` -> relative link in <script>...
        jquery.min.js: local-assets/jquery.min.js

    # possible shortcut - load assets from directory
    assets: local-assets/ 

@zdenekdrahos zdenekdrahos changed the title Feature request: Add option to bundle jQuery and bootstrap Add option to bundle jQuery and bootstrap Oct 18, 2017
@kanduvisla
Copy link
Author

kanduvisla commented Oct 18, 2017

Perhaps it would be nicer to have a boolean flag that downloads it from the CDN during build. In that case you don't need to 'pollute' your repository with assets that are not directly project-related. For example:

report:
    assets:
        # false: templates will have links to CDN (default)
        # true: assets will be downloaded and bundled with build
        bundle_with_report: true

@zdenekdrahos
Copy link
Member

Ok. At first, I thought that downloading assets during build might be a problem.
I'll ask you for review in a PR.

@kanduvisla
Copy link
Author

No, the problem is that the build server (Jenkins in this case) does not allow loading external assets to prevent XSS. If the assets are bundled with the build/reports, it should not be a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants