1 |
|
2 | # rollup-plugin-hashbang
|
3 |
|
4 | [![NPM version](https://img.shields.io/npm/v/rollup-plugin-hashbang.svg?style=flat)](https://npmjs.com/package/rollup-plugin-hashbang) [![NPM downloads](https://img.shields.io/npm/dm/rollup-plugin-hashbang.svg?style=flat)](https://npmjs.com/package/rollup-plugin-hashbang) [![CircleCI](https://circleci.com/gh/egoist/rollup-plugin-hashbang/tree/master.svg?style=shield)](https://circleci.com/gh/egoist/rollup-plugin-hashbang/tree/master) [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/egoist/donate) [![chat](https://img.shields.io/badge/chat-on%20discord-7289DA.svg?style=flat)](https://chat.egoist.moe)
|
5 |
|
6 | ## Install
|
7 |
|
8 | ```bash
|
9 | yarn add rollup-plugin-hashbang --dev
|
10 | ```
|
11 |
|
12 | ## Usage
|
13 |
|
14 | With `rollup.config.js`:
|
15 |
|
16 | ```js
|
17 | import hashbang from 'rollup-plugin-hashbang'
|
18 |
|
19 | export default {
|
20 | plugins: [
|
21 | hashbang()
|
22 | ]
|
23 | }
|
24 | ```
|
25 |
|
26 | In:
|
27 |
|
28 | ```js
|
29 | #!/usr/bin/env node
|
30 |
|
31 | console.log('hi')
|
32 | ```
|
33 |
|
34 | Output:
|
35 |
|
36 | ```js
|
37 | #!/usr/bin/env node
|
38 | 'use strict';
|
39 |
|
40 | console.log('hi')
|
41 | ```
|
42 |
|
43 | Hashbang is preserved and the output file will be executable.
|
44 |
|
45 | ## Contributing
|
46 |
|
47 | 1. Fork it!
|
48 | 2. Create your feature branch: `git checkout -b my-new-feature`
|
49 | 3. Commit your changes: `git commit -am 'Add some feature'`
|
50 | 4. Push to the branch: `git push origin my-new-feature`
|
51 | 5. Submit a pull request :D
|
52 |
|
53 |
|
54 | ## Author
|
55 |
|
56 | **rollup-plugin-hashbang** © [EGOIST](https://github.com/egoist), Released under the [MIT](./LICENSE) License.<br>
|
57 | Authored and maintained by EGOIST with help from contributors ([list](https://github.com/egoist/rollup-plugin-hashbang/contributors)).
|
58 |
|
59 | > [egoist.moe](https://egoist.moe) · GitHub [@EGOIST](https://github.com/egoist) · Twitter [@_egoistlily](https://twitter.com/_egoistlily)
|