luwes / luwes/rollup-plugin-size
Compatibility with rollup-plugin-typescript2
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 65
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Rollup: 1.29.1
NodeJS: 12.14.1
My build without `rollup-plugin-size` works, but when I add the plugin it throws the error:
```
(plugin rpt2) Error: Unknown object type "asyncfunction"
src/index.ts
Error: Unknown object type "asyncfunction"
at Object._object (PATH_TO_REPO/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:218:17)
at Object._function (PATH_TO_REPO/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:319:14)
at Object.dispatch (PATH_TO_REPO/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:185:30)
at PATH_TO_REPO/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:246:18
at Array.forEach ()
at Object._object (PATH_TO_REPO/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:242:21)
at Object.dispatch (PATH_TO_REPO/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:185:30)
at PATH_TO_REPO/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:260:23
at Array.forEach ()
at Object._array (PATH_TO_REPO/node_modules/rollup-plugin-typescript2/node_modules/object-hash/index.js:259:20)
```
Here is my `rollup.config.js`:
```js
import resolve from '@rollup/plugin-node-resolve'
import typescript from 'rollup-plugin-typescript2'
import commonjs from '@rollup/plugin-commonjs'
import autoExternal from 'rollup-plugin-auto-external'
import size from 'rollup-plugin-size'
export default [
{
input: 'src/index.ts',
output: {
file: 'dist/server-translator.cjs.js',
format: 'cjs'
},
plugins: [autoExternal(), typescript(), resolve(), commonjs(), size()]
},
{
input: 'src/index.ts',
output: {
file: '...',
format: 'esm'
},
plugins: [
autoExternal(),
typescript({
useTsconfigDeclarationDir: true,
tsconfigOverride: {
compilerOptions: {
declarationDir: 'dist/types',
declaration: true,
types: ['node', 'got']
},
include: ['src/**/*.ts'],
exclude: ['test/**/*']
}
}),
resolve(),
commonjs(),
size()
]
}
]
```
I presume there is something in using both `rollup-plugin-typescript2` and `rollup-plugin-size`. altogether. It doesn't seem that they should be related in some way, but they still do.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with rollup.config.js and the build entry point src/index.ts, reproducing the reported configuration with rollup-plugin-typescript2 and rollup-plugin-size. Trace the Unknown object type "asyncfunction" error through the nested object-hash stack. Done means the configuration builds successfully with both plugins without this error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100