diff --git a/README.md b/README.md index 05a2a1f..4600898 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,12 @@ in `main.(js|ts)` ```js import { createApp } from 'vue'; -import pdfMake from 'vue3-pdfmake'; +import { PDFPlugin } from 'vue3-pdfmake'; import App from './App.vue'; const app = createApp(App); //... -app.use(pdfMake); +app.use(PDFPlugin); //... app.mount('#app'); ``` @@ -40,6 +40,4 @@ app.mount('#app'); pdf.createPdf({}).download(); }); -``` - -> WARNING: Depending on how the instance was initialized, use `const pdf = usePDF().default` instead `const pdf = usePDF()` \ No newline at end of file +``` \ No newline at end of file diff --git a/build.config.ts b/build.config.ts index fc47783..6e56776 100644 --- a/build.config.ts +++ b/build.config.ts @@ -1,23 +1,13 @@ -export default { - entries: [ - { - input: 'src/index.ts', - outDir: 'dist', - name: 'index', - format: 'esm', - ext: 'mjs', +import { defineBuildConfig } from 'unbuild' + +export default defineBuildConfig({ + entries: [ + './src/index', + ], + rollup: { + emitCJS: true, }, - { - input: 'src/index.ts', - outDir: 'dist', - name: 'index', - format: 'cjs', - ext: 'cjs', - }, - ], - rollup: { - emitCJS: true, - }, - declaration: true, - externals: ['pdfmake'], -} \ No newline at end of file + clean: true, + declaration: true, + externals: ['pdfmake'], +}) \ No newline at end of file diff --git a/demo/src/App.vue b/demo/src/App.vue index f99e693..1331864 100644 --- a/demo/src/App.vue +++ b/demo/src/App.vue @@ -1,8 +1,4 @@