Skip to content
Snippets Groups Projects
Commit 6308b80f authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Upgrade SvelteKit specific files

parent d7d02926
No related branches found
No related tags found
No related merge requests found
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
...@@ -15,7 +15,7 @@ module.exports = { ...@@ -15,7 +15,7 @@ module.exports = {
parser: "@typescript-eslint/parser", parser: "@typescript-eslint/parser",
parserOptions: { parserOptions: {
sourceType: "module", sourceType: "module",
ecmaVersion: 2019, ecmaVersion: 2020,
}, },
root: true, root: true,
settings: { settings: {
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
"version": "0.0.288", "version": "0.0.288",
"scripts": { "scripts": {
"build": "NODE_OPTIONS=--max_old_space_size=4096 vite build", "build": "NODE_OPTIONS=--max_old_space_size=4096 vite build",
"check": "svelte-check --tsconfig ./tsconfig.json", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"dev": "vite dev", "dev": "vite dev",
"format": "prettier --write --plugin-search-dir=. .", "format": "prettier --plugin-search-dir=. --write .",
"lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .", "lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"preview": "vite preview", "preview": "vite preview",
"test": "playwright test" "test": "playwright test"
......
import node from "@sveltejs/adapter-node" import adapter from "@sveltejs/adapter-node"
import preprocess from "svelte-preprocess" import preprocess from "svelte-preprocess"
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
const svelteKitConfig = { const config = {
kit: { kit: {
// By default, `npm run build` will create a standard Node app. // By default, `npm run build` will create a standard Node app.
// You can create optimized builds for different platforms by // You can create optimized builds for different platforms by
// specifying a different adapter // specifying a different adapter
adapter: node({ adapter: adapter({
precompress: true, precompress: true,
}), }),
...@@ -19,7 +19,11 @@ const svelteKitConfig = { ...@@ -19,7 +19,11 @@ const svelteKitConfig = {
// Consult https://github.com/sveltejs/svelte-preprocess // Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors // for more information about preprocessors
preprocess: [preprocess({})], preprocess: [
preprocess({
postcss: true,
}),
],
} }
export default svelteKitConfig export default config
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
"resolveJsonModule": true, "resolveJsonModule": true,
"skipLibCheck": true, "skipLibCheck": true,
"sourceMap": true, "sourceMap": true,
"strict": false "strict": true
} }
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
} }
import { sveltekit } from "@sveltejs/kit/vite" import { sveltekit } from "@sveltejs/kit/vite"
import type { UserConfig } from "vite"
/** @type {import('vite').UserConfig} */ const config: UserConfig = {
const config = {
build: { build: {
// Increase size of chunks to 5 MB, to be able to import // Increase size of chunks to 5 MB, to be able to import
// JSON files extracted from OpenFisca country package. // JSON files extracted from OpenFisca country package.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment