sapper
sapper copied to clipboard
Some bugs related to sapper cli dev, build and export options with flag --cwd
trafficstars
I am trying to integrate sapper into nrwl/nx. So i wanted to change the structure of the folders and run into some bugs and issues:
- When using the 'build-dir' option with
sapper build, starting the server withnode __sapper__/buildfails withError: ENOENT: no such file or directory, open '../../__sapper__/build/build.json'.(Reproduce withnpm run build:builddir) - When using the flag
--cwdtogether with sapper dev, then it seems that everything compiles fine, but when I try to load the url I get(node:30240) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '__sapper__/dev/build.json'.(Reproduce withnpm run dev) sapper buildhas no static option, whereassapper exportandsapper devhave. I tried to change the reference to the static folder in the fileserver.js, but when building, the assets are not found (see my comment in the fileserver.js). Therefore it is not possible to move the static folder if a build is necessary.- In
sapper buildyou specify the output directory directly aftersapper build, insapper devandsapper exportyou specify this option with the flag--build-dirwhich is inconsistent. - I am using the sapper cli with the
--cwdflag like--cwd ./apps/web-page. I have to specify an absolute path for the--build-dirflag to make the--build-diroption work. - When I use
sapper exportwith the--build-diroption where the__sapper__folder points not to the--cwddirectory then the build part is at the specified--build-dirdirectory, but the exported files are at the specified--cwddirectory and there is no command line flag to specify a directory for the exported files. (Reproduce withnpm run export:builddir) - When using the
--cwdflag therollup.config.jsspecified at the path of the--cwdoption is used. But to makesapper dev,sapper buildorsapper exportwork, I need to have a file namedrollup.config.jsin the root directory. This file can be completely empty.
In a follow up I will also test the sapper flags --src and --routes. But for these I have to set up different repositories.
The repo can be found under https://github.com/floratmin/sample-sapper-cli-cwd-build-dir-static-options To recognize which folder is used for the static content i changed the success kid picture with a success kit picture.
Expected behavior The folder structure should be adoptable to different needs.
Information about your Sapper Installation:
- The output of
npx envinfo --system --npmPackages svelte,sapper,rollup,webpack --binaries --browsersSystem: OS: Linux 4.15 Ubuntu 18.04.2 LTS (Bionic Beaver) CPU: (8) x64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz Memory: 175.39 MB / 11.67 GB Container: Yes Shell: 4.4.19 - /bin/bash Binaries: Node: 14.11.0 - ~/.nvm/versions/node/v14.11.0/bin/node npm: 6.14.8 - ~/.nvm/versions/node/v14.11.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Browsers: Chrome: 84.0.4147.135 npmPackages: rollup: ^2.3.4 => 2.28.2 sapper: ^0.28.0 => 0.28.9 svelte: ^3.17.3 => 3.29.0 - Your browser Chrome 84
Severity
High severity, makes a 'clean' integration with nrwl/nx impossible.