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

Using combine_files() causes file to be uploaded to s3 but framework fails to provide a link to it #40

Open
zanderwar opened this issue Jun 17, 2020 · 2 comments

Comments

@zanderwar
Copy link
Contributor

zanderwar commented Jun 17, 2020

Requirements::combine_files('vendor.min.js', [
    'themes/default/node_modules/selectize/dist/js/standalone/selectize.min.js',
    'themes/default/javascript/rollbar.min.js'
]);

results in:

<script type="application/javascript" src="/"></script>

combined file is uploaded to s3 though

image

I'm not sure if this is a bug in the Requirements class, if you think this is just close it off and i'll create a ticket there

@zanderwar zanderwar changed the title Using combine_files() causes file to be uploaded to s3 but CMS fails to provide a link to it Using combine_files() causes file to be uploaded to s3 but framework fails to provide a link to it Jun 17, 2020
@obj63mc
Copy link
Collaborator

obj63mc commented Jun 17, 2020

To use S3 and Requirements you will most likely need to extended the RequirementsBackend class and configure Silverstripe to use your class as default. Basically you will need to have your new class utilize the s3 urls. If I am correct the Requirements classes look at the local filesystem only for the combined assets and if the files don't exist it breaks.

Requirements functionality, if I am correct may be deprecated as now a days most people are using modern tooling for combining assets such as CSS preprocessors and is bundlers like webpack.

@obj63mc
Copy link
Collaborator

obj63mc commented Jun 17, 2020

I would checkout the docs at https://docs.silverstripe.org/en/4/developer_guides/templates/requirements/#configuring-combined-file-storage

Basically your best course of action is to change the folder the combined assets get outputted to and setting configuration for how the filesystem looks for those files.

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