You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by Martin Kuhn <ma...@gmail.com> on 2021/02/12 16:02:12 UTC
error when process.env.NODE_ENV is available when using echarts
When I use echarts with sveltejs (and rollup build) I got an error at runtime when I do not define process.env.NODE_ENV.
The error occurs in echarts/lib/util/clazz.js.
Is this really necessary?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org
Re: error when process.env.NODE_ENV is available when using echarts
Posted by Yi Shen <sh...@gmail.com>.
Hi Martin
process.env.NODE_ENV will be replaced with 'production' or 'development' in
most of the bundlers like webpack. So the minifier can shake the dead code
only for dev environment.
If you are using rollup. There is a plugin-replace[1] can do this job
[1] https://www.npmjs.com/package/@rollup/plugin-replace
On Sat, Feb 13, 2021 at 12:44 AM Martin Kuhn <ma...@gmail.com>
wrote:
>
> When I use echarts with sveltejs (and rollup build) I got an error at
> runtime when I do not define process.env.NODE_ENV.
>
> The error occurs in echarts/lib/util/clazz.js.
>
> Is this really necessary?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
> For additional commands, e-mail: dev-help@echarts.apache.org
>
>
--
Yi Shen
Apache ECharts(incubating) PMC