bigcommerce / cornerstone

The BigCommerce Cornerstone theme
https://developer.bigcommerce.com/stencil-docs
287 stars 614 forks source link

Custom Template Javascript Module Not Working on Windows #1549

Open emilian opened 5 years ago

emilian commented 5 years ago

Expected behavior

Custom Javascript module to be imported correctly on a Windows environment.

Actual behavior

Custom Javascript classes will not be loaded at all because the context.template variable is populated using backslashes which will not map to the customClasses dictionary correctly.

Steps to reproduce behavior

  1. Create a custom template for a page and Javscript module based on the PageManager class
  2. Run Stencil locally on a Windows environment
  3. Custom module will not load when viewing the page

This is caused by the context.template variable in the assets/js/app.js file containing backslashes on a Windows environment (pages\custom\page\custom-page-template) . The path should be normalized so that it works on both Linux/Windows environments.

ghost commented 5 years ago

@emilian Thank you for reporting the issue. We will look into it.