Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moqada/babel6-strict-mode-problems
[Fixed] to reproduce problems in babel 6.
https://github.com/moqada/babel6-strict-mode-problems
Last synced: 2 days ago
JSON representation
[Fixed] to reproduce problems in babel 6.
- Host: GitHub
- URL: https://github.com/moqada/babel6-strict-mode-problems
- Owner: moqada
- License: mit
- Created: 2015-11-01T12:03:38.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-01T20:51:08.000Z (7 months ago)
- Last Synced: 2024-04-16T03:43:31.960Z (7 months ago)
- Language: JavaScript
- Homepage: https://github.com/babel/babel/issues/2719
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel6-strict-mode-problems
to reproduce problems in babel 6.
## Problems
In babel 6 with `babel-plugin-transform-strict-mode`, it generates unexpected code when includes shebang.
(also similarly using `babel-preset-es2015`)For example, source code is following.
```javascript
#!/usr/bin/env nodeconsole.log('babel!');
```Generated code is following.
```javascript
#!/usr/bin/env node'use strict';console.log('babel!');
```But, expected code is following. - babel 5 could generate -
```javascript
#!/usr/bin/env node
'use strict'console.log('babel!')
```## Reproduce
### For babel 6
```
$ cd babel6 && npm i
$ npm run build
```See `babel6/lib/cli.js`
### For babel 5
```
$ cd babel5 && npm i
$ npm run build
```See `babel5/lib/cli.js`