Skip to content

Commit

Permalink
build: move code to index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
andreashuber69 committed Jan 21, 2025
1 parent 0a72ecd commit 7aa88e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"engines": {
"node": ">=12.22"
},
"main": "dist/AsyncCssPlugin.js",
"main": "dist/index.js",
"files": [
"/dist/",
"!/**/*.map",
Expand Down
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// https://github.com/andreashuber69/async-css-plugin/blob/develop/README.md#----async-css-plugin

// eslint-disable-next-line import/no-default-export
export { default } from "./AsyncCssPlugin.ts";

export type * from "./Options.ts";
16 changes: 3 additions & 13 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,13 @@ import dts from "vite-plugin-dts";
export default defineConfig({
build: {
lib: {
entry: ["src/AsyncCssPlugin.ts"],
fileName: "AsyncCssPlugin",
entry: ["src/index.ts"],
fileName: "index",
formats: ["cjs"],
},
outDir: "dist",
rollupOptions: {
input: {
AsyncCssPlugin: "src/AsyncCssPlugin.ts",
},
},
sourcemap: true,
ssr: true,
},
plugins: [
dts({
rollupTypes: true,
tsconfigPath: "tsconfig.json",
}),
],
plugins: [dts({ rollupTypes: true })],
});

0 comments on commit 7aa88e8

Please sign in to comment.