Registry / devops / babel-preset-es2015-without-strict

babel-preset-es2015-without-strict

JSON →
library0.0.4jsnpmunverified

A Babel preset that includes all ES2015 plugins (like babel-preset-es2015) but disables the automatic prepending of 'use strict' directives. This is useful when you want ES2015 transpilation without forcing strict mode, for example when combining with other scripts that are not strict-mode compatible or when targeting environments where strict mode causes issues. Version 0.0.4 is the latest and only release; there are no updates, and the preset is now obsolete because Babel 7+ deprecated the es2015 preset in favor of individual plugins or @babel/preset-env. This preset works only with Babel 6.x.

npm install babel-preset-es2015-without-strict
INSTALL
IMPORT
SIG · BABEL-PRESET-ES201
B
babel-preset-es2015-without-strict
devopsjavascriptv0.0.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (preset)
{ "presets": ["es2015-without-strict"] }
{ "presets": ["babel-preset-es2015-without-strict"] }
In .babelrc or babel config, use the short name 'es2015-without-strict'. Using the full npm package name is incorrect.
preset via Node API
require('babel-core').transform(code, { presets: ['es2015-without-strict'] });
require('babel-core').transform(code, { presets: [require('babel-preset-es2015-without-strict')] });
Pass the preset name as a string; Babel resolves it internally. Passing the required module object is not the standard API.
preset via CLI
babel script.js --presets es2015-without-strict
babel script.js --presets babel-preset-es2015-without-strict
CLI expects the preset name without the 'babel-preset-' prefix.

Install preset, configure .babelrc, and transpile an ES2015 arrow function/export to ES5 without strict mode directive.

// Install npm install --save-dev babel-preset-es2015-without-strict babel-preset-es2015 babel-cli // .babelrc { "presets": ["es2015-without-strict"] } // Example ES2015 code (input.js) const hello = () => 'Hello World'; export default hello; // Transpile via CLI babel input.js --out-file output.js // Output will be ES5 without 'use strict' "use strict"; // this line is omitted var hello = function hello() { return 'Hello World'; }; exports.default = hello;
Debug
Known issues
deprecatedThis preset is for Babel 6 only and is no longer maintained. Babel 7 uses @babel/preset-env which can control strict mode via the 'strict' option.
fix
Upgrade to Babel 7 and use @babel/preset-env with the 'modules' and 'strict' options to achieve the same effect.
affects: >=0.0.0
breakingThe preset does not include any polyfills. You must separately include babel-polyfill or core-js for features like Promises, Map, Set, etc.
fix
Add 'babel-polyfill' to your entry point or use @babel/preset-env with 'useBuiltIns'.
affects: >=0.0.0
gotchaOmitting 'use strict' can lead to issues when transpiled code is concatenated with other scripts that rely on strict mode. In non-strict mode, 'this' in functions defaults to the global object, which can cause bugs.
fix
Ensure your final bundle is wrapped in a function scope or use a module bundler that adds strict mode per module.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Requires Babel 6.x, but you have Babel 7.x installed.
This preset is incompatible with Babel 7+.
fix
Downgrade to Babel 6, or migrate to Babel 7 and use @babel/preset-env with the 'strict' option set to false.
ReferenceError: regeneratorRuntime is not defined
The preset does not include the regenerator runtime for generators/async functions.
fix
In Babel 6, add babel-polyfill or babel-plugin-transform-runtime.
Module not found: Can't resolve 'babel-preset-es2015-without-strict'
The preset is not installed or the name is misspelled in .babelrc.
fix
Run 'npm install --save-dev babel-preset-es2015-without-strict' and use 'es2015-without-strict' (without 'babel-preset-' prefix) in config.
Upgrade
Version history
0.0.4latest on npm
Audit
Dependencies
babel-preset-es2015optionalBase preset whose plugins are included without the strict mode plugin.
Agent activity
4 hits · last 30 days
node
4
Resources
babel-preset-es2015-without-strict — npm install babel-preset-es2015-without-strict · libregistry