Add the "use strict";
directive to the top of your files if it is not there
already.
This plugin may be enabled via
babel-plugin-transform-es2015-modules-commonjs
. If you wish to disable it you can either turnstrict
off or passstrictMode: false
as an option to the commonjs transform.
$ npm install babel-plugin-transform-strict-mode
.babelrc
// without options
{
"plugins": ["transform-strict-mode"]
}
// with options
{
"plugins": [
["transform-strict-mode", {
"strict": true
}]
]
}
$ babel --plugins transform-strict-mode script.js
require("babel-core").transform("code", {
plugins: ["transform-strict-mode"]
});