While working on a project, I am using npx snowpack build --watch
instead of the dev
command because of a Flask backend. However, I am facing issues with internal imports, specifically modules importing dependencies like Bootstrap importing Popper.
The problem arises when I build the project without the --watch
command, as it takes 20-30 seconds each time, which can be quite frustrating during development. On the other hand, when running with the --watch
command, the file paths for npm modules that import other modules are incorrect, for example:
import * as Popper from '/_snowpack/pkg/@popperjs.core.v2.9.3.js';
By manually changing them to this:
import * as Popper from '../../_snowpack/pkg/@popperjs.core.v2.9.3.js';
it works fine. However, I find myself having to do this find and replace every time the watch server restarts. This issue only affects a few modules, but it would be great to resolve it and gain a better understanding of Snowpack in the process.
I am using the latest version of Snowpack installed from npm with default settings. Despite my limited experience with Snowpack and similar software, I have tried adjusting the mount and build options with no success in resolving the path problem.