Skip to content

Commit

Permalink
Update packageing config
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianMitchL committed Jan 21, 2022
1 parent 39517eb commit dfb3227
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The following CSS custom properties are optional and can be set to customize the

```svelte
<script lang="ts">
import { CompareImage } from "svelte-compare-image";
// or
import CompareImage from "svelte-compare-image/CompareImage.svelte";
</script>
Expand Down
34 changes: 33 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/svelte": "^3.0.3",
"@types/jest": "^27.4.0",
"@types/micromatch": "^4.0.2",
"@types/testing-library__jest-dom": "^5.14.2",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
Expand All @@ -37,6 +38,7 @@
"eslint-plugin-svelte3": "^3.3.0",
"eslint-plugin-testing-library": "^5.0.3",
"jest": "^27.4.7",
"micromatch": "^4.0.4",
"prettier": "^2.5.1",
"prettier-plugin-svelte": "^2.5.1",
"pretty-quick": "^3.1.3",
Expand Down
1 change: 1 addition & 0 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as CompareImage } from "./CompareImage.svelte";
12 changes: 12 additions & 0 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import adapter from "@sveltejs/adapter-static";
import preprocess from "svelte-preprocess";
import mm from "micromatch";

const dev = process.env.NODE_ENV === "development";

Expand All @@ -17,6 +18,17 @@ const config = {

// hydrate the <div id="svelte"> element in src/app.html
target: "#svelte",
package: {
exports: (filepath) => {
if (mm.isMatch(filepath, "**/*.spec.{ts,js}")) return false;
return mm.isMatch(filepath, [
"!**/_*",
"!**/internal/**",
"!**/*.spec.{ts,js}",
]);
},
files: mm.matcher("!**/?(build.*)*.spec.{ts,js}"),
},
},
};

Expand Down

0 comments on commit dfb3227

Please sign in to comment.