diff --git a/.changeset/six-tips-hear.md b/.changeset/six-tips-hear.md new file mode 100644 index 0000000..a7b3673 --- /dev/null +++ b/.changeset/six-tips-hear.md @@ -0,0 +1,5 @@ +--- +"@aiou/rollup-template": patch +--- + +fix dts files build diff --git a/package.json b/package.json index 603ffd8..0b26137 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ }, "main": "dist/index.cjs", "module": "dist/index.mjs", - "browser": "dist/rollup-template.umd.js", "types": "dist/index.d.ts", "scripts": { "build": "rimraf dist && rollup -c --silent", diff --git a/rollup.config.js b/rollup.config.js index ca87f83..e105a4c 100755 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,35 +1,13 @@ import resolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import typescript from 'rollup-plugin-typescript2' -import externals from 'rollup-plugin-node-externals' +import { externals } from 'rollup-plugin-node-externals' import alias from '@rollup/plugin-alias' import size from 'rollup-plugin-size' import ce from 'rollup-plugin-condition-exports' import { defineConfig } from 'rollup' -import pkg from './package.json' - export default defineConfig([ - // browser-friendly UMD build - { - input: 'src/index.ts', - plugins: [ - resolve(), - commonjs(), - typescript(), - alias({ - resolve: ['.ts', '.js', '.tsx', '.jsx'], - entries: [{ find: '@/', replacement: './src/' }], - }), - size(), - ], - output: { - name: 'rollup-template', - file: pkg.browser, - format: 'umd', - }, - }, - // CommonJS (for Node) and ES module (for bundlers) build. // (We could have three entries in the configuration array // instead of two, but it's quicker to generate multiple @@ -45,6 +23,7 @@ export default defineConfig([ externals({ devDeps: false, }), + commonjs(), typescript(), alias({ resolve: ['.ts', '.js', '.tsx', '.jsx'], diff --git a/tsconfig.json b/tsconfig.json index 5cd2d92..32863cd 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,7 @@ "importHelpers": true, "esModuleInterop": true, "sourceMap": true, + "declaration": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "experimentalDecorators": true, @@ -19,5 +20,6 @@ "@/*": ["src/*"] } }, + "include": ["src"], "exclude": ["node_modules", "dist"] }