discoverthreejs-site icon indicating copy to clipboard operation
discoverthreejs-site copied to clipboard

BUG

Open pflagerd opened this issue 2 years ago • 0 comments

Describe the bug As of 7bbaf74, downloading the code example using the NPM import style from this page produces a file containing cdn.skypack.dev URLs for some imports rather than using npm-aware imports.

To Reproduce Steps to reproduce the behavior:

  1. From a browser, navigate to https://discoverthreejs.com/book/introduction/about-the-book/
  2. Make sure the Import Style by the live code editor on the right side of the page is set to NPM (default)
  3. Toggle the slider to the ON position
  4. Observe the cool sparkleHorse being rendered.
  5. Observe that the sparkleHorse.js file's first line is import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'; as expected.
  6. Download the code using the Download as Zip icon.
  7. Unzip the downloaded .zip file
  8. Find the sparkleHorse.js file and observe that its first line is import { GLTFLoader } from 'https://cdn.skypack.dev/[email protected]/examples/jsm/loaders/GLTFLoader.js'; contrary to expectations

Expected behavior If the NPM Import Style is selected, expect the downloaded .zip file to exactly match the code displayed in the live code editor.

Desktop (please complete the following information):

  • OS: Linux (OpenSUSE 15.4)
  • Browser: Chrome/Chromium
  • Version: 118.0.5993.88 (Official Build) (64-bit)

pflagerd avatar Oct 22 '23 05:10 pflagerd