From 50e9f020b906c312c2d1b67488ea534f7892c376 Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Sun, 28 Mar 2021 13:34:04 -0500 Subject: [PATCH 1/3] fix: Ensures ambient types are included in publish --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 850e3e68..3a52e0c3 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,8 @@ ], "files": [ "src", - "dist" + "dist", + "index.d.ts" ], "author": "Jason Miller (http://jasonformat.com)", "license": "MIT", From 723cfa91d92d338fdd7ee1ff62eb84ec2fb97323 Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Sun, 28 Mar 2021 13:34:17 -0500 Subject: [PATCH 2/3] docs: Adds note on TS + CSS Module usage --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e7b8bcdb..bc292afe 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,8 @@ Just point the input to a `.ts` file through either the cli or the `source` key Microbundle will generally respect your TypeScript config defined in a `tsconfig.json` file with notable exceptions being the "[target](https://www.typescriptlang.org/tsconfig#target)" and "[module](https://www.typescriptlang.org/tsconfig#module)" settings. To ensure your TypeScript configuration matches the configuration that Microbundle uses internally it's strongly recommended that you set `"module": "ESNext"` and `"target": "ESNext"` in your `tsconfig.json`. +If you're using TypeScript with CSS Modules, you will want to set `"include": ["node_modules/microbundle/index.d.ts"]` in your `tsconfig.json` to tell TypeScript how to handle your CSS Module imports. + ### CSS and CSS Modules Importing CSS files is supported via `import "./foo.css"`. By default, generated CSS output is written to disk. The `--css inline` command line option will inline generated CSS into your bundles as a string, returning the CSS string from the import: From 27d497e049d8c5164f357fe9df858f661defe600 Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Sun, 28 Mar 2021 13:44:40 -0500 Subject: [PATCH 3/3] docs: Adding changeset --- .changeset/dirty-islands-fail.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/dirty-islands-fail.md diff --git a/.changeset/dirty-islands-fail.md b/.changeset/dirty-islands-fail.md new file mode 100644 index 00000000..a1bb8356 --- /dev/null +++ b/.changeset/dirty-islands-fail.md @@ -0,0 +1,5 @@ +--- +'microbundle': patch +--- + +Ensures ambient type declaration for CSS Modules is included in the published bundle