You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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 viayarn add lightense-images
Import Lightense in
src/scripts/layout/theme.js
by addingimport 'lightense-images';
to the file.You can see the JS loading in Chrome dev tools in
theme.js
butLightense
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 withlightense.es6
, but this did not fix the issue, though the change was reflected intheme.js
It's also worth noting that
lightense.js
functions properly when the file contents are included in the HTML inline.The text was updated successfully, but these errors were encountered: