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

Issue with including lightense-images in Shopify Slate environment #37

Open
neckerson opened this issue Apr 24, 2019 · 0 comments
Open

Comments

@neckerson
Copy link

When adding Lightense to a Shopify store development environment with Webpack, the library fails to expose the Lightense module in a way that can be accessed in the HTML body.

Replicate Issue
Run git clone [email protected]:Shopify/slate.git

Create a new directory and run yarn create slate-theme my-new-theme. Finish setting the .env variables via these instructions.

Install Lightense in the my-new-theme directory via yarn add lightense-images

Import Lightense in src/scripts/layout/theme.js by adding import 'lightense-images'; to the file.

You can see the JS loading in Chrome dev tools in theme.js but Lightense cannot be accessed.

Notes
I think this has something to do with how Webpack is processing lightense.js. I replaced the contents of this file with lightense.es6, but this did not fix the issue, though the change was reflected in theme.js

It's also worth noting that lightense.js functions properly when the file contents are included in the HTML inline.

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

1 participant