Skip to content

Commit

Permalink
Allow dev server to import cwd & root via @fs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaehring committed Aug 31, 2023
1 parent eb9cebe commit 7facf63
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/field-kit/bin/field-scripts/develop-module/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ export default async function develop(options = {}) {
},
server: {
port,
/**
* Explicitly use strict mode on the file system (already Vite's default), but
* also add both the root and the cwd to the allow list. Vite will only include
* the root by default, not the cwd.
* @see https://vitejs.dev/config/server-options.html#server-fs-allow
*/
fs: {
strict: true,
allow: [cwd, root],
},
proxy: {
[`/${FM_API_ENDPOINT}`]: proxyPort(9000),
[`/${FM_SCRIPT_DIR}/${snake(config.name)}/`]: proxyPort(9000),
Expand Down

0 comments on commit 7facf63

Please sign in to comment.