Skip to content

Commit

Permalink
ref: deprecated umd format (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangWeixian authored Apr 23, 2022
1 parent 0ff563a commit 6a0ae97
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .changeset/six-tips-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aiou/rollup-template": patch
---

fix dts files build
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
25 changes: 2 additions & 23 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -45,6 +23,7 @@ export default defineConfig([
externals({
devDeps: false,
}),
commonjs(),
typescript(),
alias({
resolve: ['.ts', '.js', '.tsx', '.jsx'],
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"importHelpers": true,
"esModuleInterop": true,
"sourceMap": true,
"declaration": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"experimentalDecorators": true,
Expand All @@ -19,5 +20,6 @@
"@/*": ["src/*"]
}
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}

0 comments on commit 6a0ae97

Please sign in to comment.