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

css resources referenced by libs not being bundled in the WAR #1512

Closed
sospirited opened this issue Sep 8, 2015 · 2 comments
Closed

css resources referenced by libs not being bundled in the WAR #1512

sospirited opened this issue Sep 8, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@sospirited
Copy link
Member

Noticed this issue as part of going from a pre-1.0 version of BRJS to the latest.

Relevant files on disk:

  1. <app>/libs/mylibrary/loginscreen/style.css
background-image: url('images/login-title.png');
  1. <app>/libs/mylibrary/loginscreen/images/login-title.png
  2. <app>/libs/mylibrary/thirdparty-lib.manifest
depends: css-reset
css: "**/*.css"
exports: null
  1. <app>/login-aspect/index.html
<script>
  br.Core.thirdparty('mylibrary');
</script>

The above works fine in BRJS but when the war is built:
brjs build-app <app> -w

Then I do not see the following resource in the WAR:
<warFile>/login/v/<number>/cssresource/lib_mylibrary/loginscreen/images/login-title.png

Things to note:

  • non-default aspect is used
  • the theme css file is from a subfolder
  • the referenced image is in a subfolder relative to the css file
  • works in BRJS dev mode, not in the WAR
  • workaround of moving the login-tile to be parallel to the style.css file leads to the image being bundled so there definitely seems to be an issue with the subfolder?
@andy-berry-dev andy-berry-dev added this to the 1.1 milestone Sep 8, 2015
@andy-berry-dev andy-berry-dev self-assigned this Sep 10, 2015
andy-berry-dev pushed a commit that referenced this issue Sep 10, 2015
- fix the underlying bug for #1512 where nested images with the same
  name as another nested couldnt have images due to the require path
  calculation not being unique enough
- adding more tests to ensure that CssResources are included in
  built apps
- also includes a change to BundlableNodeVerifier so it sorts content
  paths that have assertions against them to ensure the ordering is
  always the same and we dont have brittle tests
@andy-berry-dev
Copy link
Member

So the underling bug here was the require paths for Thirdparty lib directories weren't being calculated so they were unique enough. This meant that having 2 directories called images, e.g. foo/bar/images and some/dir/images both had the same require path and one wasn't picked up in the dependency analysis process properly and ultimate deemed to not exist when working out if assets were used.

#1519 fixes this and also adds a number of tests to ensure that we bundle most types of common image formats whether they are used or not (something we'd supported beforehand anyway but had few tests around).

@thecapdan
Copy link
Contributor

managed to reproduce the bug with multiple subfolders (no need for non default aspect). the fix works. tests have been reviewed. done

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

No branches or pull requests

4 participants