sveldoc
Version:
Readme-driven Development for building Svelte components
32 lines (31 loc) • 1.9 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.defineConfig = void 0;
const svelte_preprocess_1 = require("svelte-preprocess");
const vite_plugin_svelte_1 = require("@sveltejs/vite-plugin-svelte");
const get_tsconfig_paths_1 = require("./utils/get-tsconfig-paths");
const plugin_index_1 = require("./plugin-index");
const plugin_readme_1 = require("./plugin-readme");
const preprocess_readme_1 = require("./preprocess-readme");
const defineConfig = (options) => {
var _a, _b, _c;
const styles = (_a = options === null || options === void 0 ? void 0 : options.styles) !== null && _a !== void 0 ? _a : "";
const resetStyles = (options === null || options === void 0 ? void 0 : options.resetStyles) === true;
const base = (_b = options === null || options === void 0 ? void 0 : options.base) !== null && _b !== void 0 ? _b : "./";
const branch = options === null || options === void 0 ? void 0 : options.branch;
return Object.assign(Object.assign({}, options), { base, resolve: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.resolve), { alias: Object.assign(Object.assign({}, (_c = options === null || options === void 0 ? void 0 : options.resolve) === null || _c === void 0 ? void 0 : _c.alias), (0, get_tsconfig_paths_1.getTsconfigPaths)()) }), plugins: [
(0, plugin_index_1.pluginIndex)({
styles,
resetStyles,
}),
(0, vite_plugin_svelte_1.svelte)({
extensions: [".svelte", ".md"],
preprocess: [(0, svelte_preprocess_1.typescript)(), (0, preprocess_readme_1.preprocessReadme)({ base, branch })],
}),
(0, plugin_readme_1.pluginReadme)(),
], test: {
globals: true,
environment: "jsdom",
} });
};
exports.defineConfig = defineConfig;
;