简体   繁体   English

如何从 babel 处理的汇总包中删除 use strict

[英]how to remove use strict from rollup bundle processed by babel

I tried plugin transform-remove-strict-mode but it doesn't worked.我尝试了插件 transform-remove-strict-mode 但它不起作用。 Result format is iife and I'm using rollup in gulp (and babel as a rollup plugin).结果格式是 iife,我在 gulp 中使用汇总(并将 babel 作为汇总插件)。

根据文档output选项中使用strict: false

Just make sure you specify strict: false in the config output object.只需确保在配置输出对象中指定strict: false即可。

input: [...],
output: {
    ...,
    strict: false,
},
plugins: [...],

You can see the default options here: https://rollupjs.org/guide/en/#configuration-files您可以在此处查看默认选项: https ://rollupjs.org/guide/en/#configuration-files

添加useStrict: false到汇总配置完成了这项工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM