dev server breaks plugin resolve/load() #1964
Replies: 2 comments
-
Happy to help! But, I can't reproduce. I can see the translations happening in dev: |
Beta Was this translation helpful? Give feedback.
-
Hmm... strange. Now that I test it with a fresh checkout and a new I think I'll make several more attempts to reproduce this - it definitely had been behaving as if the resolve feature was half-functional and persisted across multiple restarts of the dev server. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm using
snowpack-plugin-raw-file-loader
- a plugin that turns raw files with designated extensions into loadable modules - in an application. The problem is, the loader works only withsnowpack build
- when I runsnowpack dev
, the imports result in 404 because the dev server thinks the translated.js
files do not exist.Example usage:
I've checked the source of the plugin, and it appears very simple - resolves the configured file extensions (in this case,
[ '.ftl' ]
) to[ '.js' ]
. Itsload
function is executed properly inbuild
mode - but not indev
! I've verified this by addingconsole.log
statements to theload
function and itsconfig
function. It looks likeconfig()
is executed always - in dev, and in build; however,load()
is only ever executed inbuild
but not indev
.Another observation is that if I refer to the dev server via the original filename - so in my case
http://localhost:8080/translations/pl.ftl
- notice no.js
mangling - then it does return the file with the proper (translated) contents, though asapplication/octet-stream
.Here's the file that is causing the problematic difference between dev mode and build mode: https://github.com/rkaw92/file-transfer/blob/main/public/l10n.js
Beta Was this translation helpful? Give feedback.
All reactions