diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 75bf1d9..0000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "benchmark/realworld"] - path = benchmark/realworld - url = git@github.com:sveltejs/realworld.git -[submodule "benchmark/realworld-with-glory"] - path = benchmark/realworld-with-glory - url = git@github.com:sveltejs/realworld.git -[submodule "benchmark/kit-example"] - path = benchmark/kit-example - url = https://github.com/sveltejs/kit.git diff --git a/benchmark/README.md b/benchmark/README.md deleted file mode 100644 index 1f7d270..0000000 --- a/benchmark/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Benchmark for using glory-svelte-preprocess on existing project - -## Result - - - -## How did I get the file size? - -Run the following commands in each repo to get the file size for css and js: - -``` -npm install -npm run build -dua ./build/**/*.css -dua ./build/**/*.js -``` - diff --git a/benchmark/kit-example b/benchmark/kit-example deleted file mode 160000 index 0bc6648..0000000 --- a/benchmark/kit-example +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0bc66484024eafcc7aa6fcc1aebc2ba92e5f129a diff --git a/benchmark/realworld b/benchmark/realworld deleted file mode 160000 index d35ef7c..0000000 --- a/benchmark/realworld +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d35ef7c1cb6f3bc3c3f318ccd58015a37d56ca6e diff --git a/benchmark/realworld-with-glory b/benchmark/realworld-with-glory deleted file mode 160000 index d35ef7c..0000000 --- a/benchmark/realworld-with-glory +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d35ef7c1cb6f3bc3c3f318ccd58015a37d56ca6e diff --git a/example/src/routes/__layout.svelte b/example/src/routes/__layout.svelte new file mode 100644 index 0000000..eb04318 --- /dev/null +++ b/example/src/routes/__layout.svelte @@ -0,0 +1,8 @@ + + + diff --git a/test/transformer.spec.js b/test/transformer.spec.js index 0610921..07e484c 100644 --- a/test/transformer.spec.js +++ b/test/transformer.spec.js @@ -39,39 +39,3 @@ describe("when transforming html", function () { ); }); }); - -describe("when transforming CSS", function () { - const componentCode = ` - -

Hello world

`; - - const filename = "/src/index.svelte"; - - const classCache = { - "/src/__layout.svelte": { bar: { a: true } }, - [filename]: { foo: { a: true } }, - }; - - const declarationCache = { - none: { "color:red;": "a" }, - }; - - describe("when identical declaration is found in __layout.svelte", function () { - const ast = parse(componentCode, { filename }); - const transformer = createTransformer(componentCode, filename).transformCss( - ast.css, - declarationCache, - classCache, - ); - - it("should remove that declaration found in current component", async () => { - expect(transformer.toString().replace(/\s/g, "")).toBe( - `

Hello world

`.replace(/\s/g, "") - ); - }); - }); -});