Skip to content

Commit de85583

Browse files
committed
fix(create-config): default emitCss to false
1 parent d36fb21 commit de85583

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.1.1](https://github.com/metonym/svelte-readme/releases/tag/v2.1.1) - 2020-12-30
9+
10+
- Default `svelte.emitCss` to `false`
11+
812
## [2.1.0](https://github.com/metonym/svelte-readme/releases/tag/v2.1.0) - 2020-12-30
913

1014
- Infer development mode if `process.env.ROLLUP_WATCH` is `true`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-readme",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"license": "MIT",
55
"description": "Develop and demo your Svelte components in your README.md",
66
"author": "Eric Liu (https://github.com/metonym)",

src/createConfig.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { createHash } from "crypto";
99
import htmlminifier from "html-minifier";
1010
import { css } from "./style";
1111
import { Plugin, OutputOptions, InputOptions } from "rollup";
12+
import { PreprocessorGroup } from "svelte/types/compiler/preprocess";
1213

1314
function hashREADME() {
1415
try {
@@ -134,30 +135,25 @@ export default function createConfig(opts: Partial<CreateConfigOptions>): InputO
134135
const hash = minify ? hashREADME() : "";
135136
const output_dir = opts.outDir || "dist";
136137
const svelte: Partial<RollupPluginSvelteOptions> = {
138+
emitCss: opts.svelte?.emitCss ?? false,
137139
compilerOptions: {
138140
dev: DEV,
139141
immutable: true,
142+
...opts.svelte?.compilerOptions,
140143
},
141-
extensions: [".svelte", ".md"],
142-
preprocess: [preprocessReadme({ ...pkg, prefixUrl: opts.prefixUrl })],
144+
extensions: [".svelte", ".md", ...(opts.svelte?.extensions ?? [])],
145+
preprocess: [
146+
...((opts.svelte?.preprocess as PreprocessorGroup[]) ?? []),
147+
preprocessReadme({ ...pkg, prefixUrl: opts.prefixUrl }),
148+
],
143149
};
144150

145-
if (opts.svelte?.compilerOptions) {
146-
svelte.compilerOptions = {
147-
...svelte.compilerOptions,
148-
...opts.svelte.compilerOptions,
149-
};
150-
}
151-
152-
if (opts.svelte?.extensions) {
153-
svelte.extensions = [...svelte.extensions!, ...opts.svelte.extensions];
154-
}
155-
156151
console.log(`[createConfig] Running in ${DEV ? "development" : "production"}`);
157152
console.log("[createConfig] options:");
158153
console.group();
159154
console.log("minify:", minify);
160155
console.log("outDir:", output_dir);
156+
console.log("svelte:", svelte);
161157
console.groupEnd();
162158

163159
const template = `

0 commit comments

Comments
 (0)