zrender icon indicating copy to clipboard operation
zrender copied to clipboard

wrong 'sideEffects' in the package.json file

Open alienzhou opened this issue 3 years ago • 0 comments

The module entry index.js("module": "index.js",) imports lib/all.js.

https://github.com/ecomfe/zrender/blob/559d610bd0a612fa8ed5a7e6a8dd4b23a318e94d/src/all.ts#L7-L8

But this module is not in the 'sideEffects':

https://github.com/ecomfe/zrender/blob/559d610bd0a612fa8ed5a7e6a8dd4b23a318e94d/package.json#L36-L39

When using esbuild to bundle zrender, it will remove these as a default behaviour https://esbuild.github.io/api/#ignore-annotations

require('esbuild').build({
    entryPoints: ['zrender'],
    bundle: true,
    format: 'esm',
    target: 'es2020',
    outdir: './output',
})

So users have to set ignoreAnnotations: true to avoid it.

Updating the missing modules or removing 'sideEffects' field in the package.json may work.

alienzhou avatar Jun 15 '22 04:06 alienzhou