mirror of
https://github.com/koloml/furbooru-tagging-assistant.git
synced 2026-02-06 23:32:58 +00:00
Having $lib/component with just $component was a bit confusing, especially since $lib is also used in Svelte components all over the place. This move will hopefully make it less confusing for me.
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
import adapter from '@sveltejs/adapter-static';
|
|
import {vitePreprocess} from "@sveltejs/vite-plugin-svelte";
|
|
import * as fs from "fs";
|
|
|
|
/** @type {import('@sveltejs/kit').Config} */
|
|
const config = {
|
|
kit: {
|
|
// Can't use default _app, since "_" is reserved symbol in Chrome
|
|
appDir: "assets/popup",
|
|
adapter: adapter({
|
|
strict: false
|
|
}),
|
|
version: {
|
|
name: Date.now().toString(36)
|
|
},
|
|
alias: {
|
|
"$config": "./src/config",
|
|
"$content": "./src/content",
|
|
"$components": "./src/components",
|
|
"$styles": "./src/styles",
|
|
"$stores": "./src/stores",
|
|
"$entities": "./src/lib/extension/entities",
|
|
"$tests": "./tests"
|
|
},
|
|
typescript: {
|
|
config: config => {
|
|
config.compilerOptions = config.compilerOptions || {};
|
|
config.compilerOptions.allowImportingTsExtension = true
|
|
}
|
|
}
|
|
},
|
|
preprocess: [
|
|
vitePreprocess({
|
|
// SCSS is used by the project
|
|
style: {
|
|
postcss: true
|
|
}
|
|
})
|
|
]
|
|
};
|
|
|
|
// Providing the version from package.json for rendering it in the UI.
|
|
if (fs.existsSync('package.json')) {
|
|
const packageInformation = JSON.parse(
|
|
fs.readFileSync('package.json', 'utf8')
|
|
);
|
|
|
|
config.kit.version.name = packageInformation.version;
|
|
}
|
|
|
|
export default config;
|