I installed a fresh SvelteKit per the documentation and receive this error if I attempt to use $app in the svelte config.
Error in svelte.config.js
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '$app' imported from /Users/username/projects/my-app/svelte.config.js
The code looks like -
import preprocess from 'svelte-preprocess';
import adapter from '@sveltejs/adapter-static';
import { dev } from '$app/env';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess(),
kit: {
adapter: adapter(),
paths: {
base: dev ? '' : '/CapitalBikesProject'
},
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte'
}
};
export default config;
How do I access dev mode inside the config javascript file? Thank you!