Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove use strict from rollup bundle processed by babel

I tried plugin transform-remove-strict-mode but it doesn't worked. Result format is iife and I'm using rollup in gulp (and babel as a rollup plugin).

like image 254
dev1223 Avatar asked Feb 21 '17 21:02

dev1223


People also ask

Is there a way to remove strict mode in Babel?

There's now a babel plugin that you can add to your config that will remove strict mode: babel-plugin-transform-remove-strict-mode. It's a little ugly in that the "use strict" gets added and then removed, but it makes the config much nicer.

Is there a way to make a Babel 6 plugin strict?

For babel 6 instead of monkey patching the preset and/or forking it and publishing it, you can also just wrap the original plugin and set the strict option to false.

How to fix @Babel/polyfill is deprecated?

As of today, it seems that @babel/polyfill is now deprecated. It is said to use manually the core-js and regenerator-runtime. Here is how I solve the issue. Install the necessary dependencies. Configure Babel. Configure Rollup. Sorry, something went wrong. update code.js成3, 移除babel/polyfill與 core.js2的舊設定, 改用babel/runtime來做li…

What is rollup doing with the issues backlog?

The Rollup team is attempting to clean up the Issues backlog in the hopes that the active and still-needed, still-relevant issues bubble up to the surface. With that, we're closing issues that have been open for an eon or two, and have gone stale like pirate hard-tack without activity.


1 Answers

Use strict: false in the output options as per the documentation.

like image 123
koszyq Avatar answered Oct 22 '22 11:10

koszyq