anoduck / mod-timelinejs

Hinode module for adding a more dynamic and robust timeline with KnightLab's TimelineJS3
MIT License
0 stars 0 forks source link

Sources fail to load on install #6

Open anoduck opened 2 weeks ago

anoduck commented 2 weeks ago

For some reason, cpy is failing to copy resources. This is probably due to the rexreplace command failing. This command probably should be moved to the back of the postinstall sequence.


  "scripts": {
    "prestart": "npm run clean && npm run mod:vendor",
    "start": "hugo server -s exampleSite --bind=0.0.0.0 --disableFastRender --printI18nWarnings",
    "prebuild": "npm run clean && npm run mod:vendor",
    "build": "hugo --gc --minify -s exampleSite",
    "clean": "rimraf exampleSite/public exampleSite/resources",
    "mod:clean": "hugo mod clean",
    "mod:update": "rimraf _vendor && hugo mod get -u ./... && hugo mod get -u && npm run -s mod:vendor && npm run -s mod:tidy",
    "mod:tidy": "hugo mod tidy",
    "mod:vendor": "rimraf _vendor && hugo mod vendor",
    "postinstall": "npm run -s copy:css && npm run -s copy:rexrep && npm run -s copy:js && npm run -s copy:font_scss && npm run -s copy:icons",
    "copy:css": "cpy node_modules/@knight-lab/timelinejs/dist/css/timeline.css dist --rename=timeline.scss --flat",
    "copy:rexrep": "rexreplace '..\/js\/..\/css\/icons\/' '/' dist/timeline.scss", //<-FAILS
    "copy:js": "cpy node_modules/@knight-lab/timelinejs/dist/js/timeline.js dist/js --flat",
    "copy:font_scss": "cpy node_modules/@knight-lab/timelinejs/dist/css/fonts/font.default.css dist --rename=font.default.scss --flat", //<-FAILS
    "copy:icons": "cpy node_modules/@knight-lab/timelinejs/dist/css/icons/tl-icons.woff2 dist --flat", //<-FAILS
    "test": "npm run -s build",
    "upgrade": "npx npm-check-updates -u && npm run -s mod:update",
    "prepare": "node .husky/install.mjs"
  },
anoduck commented 2 weeks ago

Everything works in the example site when running tests, but on actual installation and use in a production site, the module fails to deliver satisfactory results. This is being attributed to html resource loading security policies.

anoduck commented 2 weeks ago

I was unaware of merging a pull request, while mentioning this issue would cause it to automatically close. Which is cool and all, but no intentional.

Everything still looks good on the test site, but when it comes to the actual working example, it still fails to load everything.