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

Break out at the moment of concatenate with other files #686

Open
tayan-serna opened this issue Feb 27, 2018 · 1 comment
Open

Break out at the moment of concatenate with other files #686

tayan-serna opened this issue Feb 27, 2018 · 1 comment

Comments

@tayan-serna
Copy link

Environment:

  • Preview version: 1.29.0
  • Browser name and version: Google Chrome Versión 63.0.3239.132
  • Operating system and version: Windows 10

Steps to reproduce the problem:

  1. yarn run prod
  2. Concatenate with other JS files

What is the expected behavior?
The box-content-preview library should work when is concatenated with another JS

What went wrong?
At the moment when the library its concatenated with other ones show this message
image

We're using your library in our project. In dev mode we're including all files listed and works just fine.
But when we build for production, our process takes all JS and minifies and concat all files in a single one (builtApp.js)
At this point, there is a check (https://github.com/box/box-content-preview/blob/master/src/lib/util.js#L603) for a <script... src=".../preview.js... that give us the error image

We're trying to sort this issue out by adding dependencies directly to our index.html pointing CDN but we would like to know why is that check, why do you expect to have it like that; maybe we can do some changes and minification would work on this project

@tonyjin
Copy link
Contributor

tonyjin commented Mar 1, 2018

This is related to #521. Currently we need the location of preview.js since we depend on third party assets (e.g. viewer assets like pdf.js, shaka-player.js, etc.). That combined with not wanting to load all third party assets together into one bundle (3D runtime assets are huge and aren't used at all if you're just viewing documents) lead us to an implementation where we expect a specific folder structure.

You may want to explore using https://github.com/box/box-ui-elements/blob/master/src/wrappers/ContentPreview.js in the short term while we figure out a long term solution.

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

2 participants