main ea6b0d474de1 cached
18 files
16.5 KB
5.1k tokens
8 symbols
1 requests
Download .txt
Repository: thgh/rollup-plugin-livereload
Branch: main
Commit: ea6b0d474de1
Files: 18
Total size: 16.5 KB

Directory structure:
gitextract_mtf7ex3r/

├── .github/
│   └── workflows/
│       └── pr.yml
├── .gitignore
├── .prettierrc
├── CHANGELOG.md
├── LICENSE.md
├── README.md
├── package.json
├── src/
│   └── index.ts
├── test/
│   ├── config/
│   │   ├── entry.js
│   │   ├── index.html
│   │   └── rollup.config.js
│   ├── config.test.ts
│   ├── entry/
│   │   ├── entry.js
│   │   ├── index.html
│   │   └── rollup.config.js
│   ├── entry.test.ts
│   └── shared.ts
└── tsconfig.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/pr.yml
================================================
name: Test
on: push
jobs:
  test:
    name: Run tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18
      - run: yarn install --frozen-lockfile
      - run: yarn lint
      - run: yarn test


================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*

# Dependency directory
node_modules

# Unwanted
.idea
.DS_Store

# Build files
dist/*
test/*/dest.js


================================================
FILE: .prettierrc
================================================
{
  "arrowParens": "avoid",
  "semi": false,
  "singleQuote": true,
  "trailingComma": "es5"
}


================================================
FILE: CHANGELOG.md
================================================
# Changelog

All notable changes to `rollup-plugin-livereload` will be documented in this file.

## [Unreleased]

## [2.0.0] - 2020-08-28

### Removed

- Dropped support for Node.js below v8.3

### Changed

- Will automatically find an available port if the requested one is in use. ([#23](https://github.com/thgh/rollup-plugin-livereload/issues/23)) @appsforartists

## [1.3.0] - 2020-04-28

### Changed

- Fix codesandbox support

## [1.2.0] - 2020-03-19

### Added

- Add support for IE8 ([#43](https://github.com/thgh/rollup-plugin-livereload/issues/43)) @thgh

### Changed

- Only keep 1 server instance running ([#33](https://github.com/thgh/rollup-plugin-livereload/issues/33)) @rixo

## [1.1.0] - 2020-03-19

### Added

- Add support for codesandbox.io ([#37](https://github.com/thgh/rollup-plugin-livereload/issues/37)) @jakobrosenberg

## [1.0.4] - 2019-10-05

### Changed

- Update livereload to 0.8.0 || ^0.8.2

## [1.0.0] - 2019-01-27

### Changed

- Add support for Rollup 1 @yohangz

## [0.0.1] - 2016-09-24

### Added

- Initial version

[unreleased]: https://github.com/thgh/rollup-plugin-livereload/compare/v2.0.0...HEAD
[2.0.0]: https://github.com/thgh/rollup-plugin-livereload/compare/v1.3.0...v2.0.0
[1.3.0]: https://github.com/thgh/rollup-plugin-livereload/compare/v1.2.0...v1.3.0
[0.0.2]: https://github.com/thgh/rollup-plugin-livereload/compare/v0.0.1...v0.0.2
[0.0.1]: https://github.com/thgh/rollup-plugin-livereload/releases


================================================
FILE: LICENSE.md
================================================
The MIT License (MIT)

Copyright (c) 2016 Thomas Ghysels

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# Rollup plugin LiveReload

<a href="LICENSE">
  <img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="Software License" />
</a>
<a href="https://github.com/thgh/rollup-plugin-livereload/issues">
  <img src="https://img.shields.io/github/issues/thgh/rollup-plugin-livereload.svg" alt="Issues" />
</a>
<a href="http://standardjs.com/">
  <img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg" alt="JavaScript Style Guide" />
</a>
<a href="https://npmjs.org/package/rollup-plugin-livereload">
  <img src="https://img.shields.io/npm/v/rollup-plugin-livereload.svg?style=flat-squar" alt="NPM" />
</a>
<a href="https://github.com/thgh/rollup-plugin-livereload/releases">
  <img src="https://img.shields.io/github/release/thgh/rollup-plugin-livereload.svg" alt="Latest Version" />
</a>

## Installation

```
npm install --save-dev rollup-plugin-livereload
```

## Usage

```js
// rollup.config.js
import livereload from 'rollup-plugin-livereload'

export default {
  input: 'entry.js',
  output: { file: 'bundle.js' },
  plugins: [livereload()],
}
```

To make it a real dev-server, combine this plugin with [rollup-plugin-serve].

```js
// rollup.config.js
import serve from 'rollup-plugin-serve'
import livereload from 'rollup-plugin-livereload'

export default {
  input: 'entry.js',
  output: { file: 'bundle.js' },
  plugins: [
    serve(), // index.html should be in root of project
    livereload(),
  ],
}
```

### Options

By default, it watches the current directory. If you also have css output, pass the folder to which the build files are written.

This plugin supports the following options:

- `clientUrl`: provide an alternative URL to the `livereload.js` script/resource. This URL is always preferred over all other generated URLs.
- `clientHostname`: alternative hostname used instead of `localhost` or the site's current host, where the bundle is fetched from. Use this option when you include your bundle from a different host.

All remaining options are passed to [`livereload.createServer()`][livereload].

Example:

```
livereload('dist')

// --- OR ---

livereload({
  watch: 'dist',
  verbose: false, // Disable console output

  // other livereload options
  port: 12345,
  delay: 300,
  https: {
      key: fs.readFileSync('keys/agent2-key.pem'),
      cert: fs.readFileSync('keys/agent2-cert.pem')
  }
})
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Contributions and feedback are very welcome.

To get it running:

1. Clone the project.
2. `npm install`
3. `npm run build`

## Credits

- [Thomas Ghysels](https://github.com/thgh)
- [All Contributors][link-contributors]

## License

The MIT License (MIT). Please see [License File](LICENSE) for more information.

[link-author]: https://github.com/thgh
[link-contributors]: ../../contributors
[livereload]: https://www.npmjs.com/package/livereload
[rollup-plugin-serve]: https://www.npmjs.com/package/rollup-plugin-serve


================================================
FILE: package.json
================================================
{
  "name": "rollup-plugin-livereload",
  "version": "2.0.5",
  "description": "Rollup plugin for LiveReload that watches the bundle and reloads the page on change",
  "type": "module",
  "main": "dist/index.cjs",
  "module": "dist/index.js",
  "types": "dist/index.d.cts",
  "exports": {
    ".": {
      "import": {
        "default": "./dist/index.js",
        "types": "./dist/index.d.ts"
      },
      "require": {
        "default": "./dist/index.cjs",
        "types": "./dist/index.d.cts"
      }
    }
  },
  "scripts": {
    "build": "tsup src/index.ts --clean --format esm,cjs --cjsInterop --dts",
    "dev": "npm run build -- --watch",
    "lint": "prettier -l .",
    "fix": "prettier --write .",
    "test": "vitest --single-thread",
    "prepare": "npm run build"
  },
  "keywords": [
    "rollup",
    "rollup-plugin",
    "livereload",
    "lr"
  ],
  "license": "MIT",
  "author": "Thomas Ghysels <info@thomasg.be>",
  "homepage": "https://github.com/thgh/rollup-plugin-livereload",
  "bugs": {
    "url": "https://github.com/thgh/rollup-plugin-livereload/issues"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/thgh/rollup-plugin-livereload"
  },
  "files": [
    "dist"
  ],
  "engines": {
    "node": ">=16"
  },
  "dependencies": {
    "@types/livereload": "^0.9.1",
    "livereload": "^0.9.1"
  },
  "devDependencies": {
    "@types/ws": "^8.5.5",
    "port-authority": "^1.1.1",
    "prettier": "^3.0.1",
    "rollup": "3",
    "rollup-plugin-serve": "1",
    "tsup": "^7.2.0",
    "typescript": "^5.1.6",
    "vitest": "^0.34.1"
  }
}


================================================
FILE: src/index.ts
================================================
import {
  createServer,
  type LiveReloadServer,
  type CreateServerConfig,
} from 'livereload'
import { resolve } from 'path'
import { find } from 'port-authority'
import { type Plugin } from 'rollup'

declare global {
  var PLUGIN_LIVERELOAD: { server: LiveReloadServer | null }
}

const state = (global.PLUGIN_LIVERELOAD = global.PLUGIN_LIVERELOAD || {
  server: null,
})

/**
 * Find all `livereload` options here:
 * https://www.npmjs.com/package/livereload#user-content-server-api
 */
export interface RollupLivereloadOptions extends CreateServerConfig {
  /**
   * A directory or a set of directories to watch for changes.
   * @default the current directory
   */
  watch?: string | string[]

  /**
   * Whether or not to inject the `livereload` snippet into the bundle which
   * will enable `livereload` in your web app.
   * @default true
   */
  inject?: boolean

  /**
   * Log a message to console when `livereload` is ready.
   * @default true
   */
  verbose?: boolean

  /**
   * Override the snippet URL
   * @example "//localhost:35729/livereload.js?snipver=1"
   */
  clientUrl?: string

  /**
   * Override the hostname of the snippet URL
   * @example "example.test"
   */
  clientHostname?: string
}

/**
 * 🔄 A Rollup plugin for including `livereload` in your web app.
 */
export default function livereload(
  options?: RollupLivereloadOptions | string
): Plugin {
  const parsedOptions = options ? parseOptions(options) : {}

  // release previous server instance if rollup is reloading configuration
  // in watch mode
  if (state.server) {
    state.server.close()
  }

  let enabled = parsedOptions.verbose === false
  const portPromise = find(parsedOptions.port || 35729)

  portPromise.then(port => {
    state.server = createServer({ ...parsedOptions, port })

    // Start watching
    if (Array.isArray(parsedOptions.watch)) {
      state.server.watch(
        parsedOptions.watch.map(w => resolve(process.cwd(), w))
      )
    } else {
      state.server.watch(resolve(process.cwd(), parsedOptions.watch || ''))
    }
  })

  return {
    name: 'livereload',
    async banner() {
      if (parsedOptions.inject === false) {
        return ''
      }
      const port = await portPromise
      const snippetSrc = parsedOptions.clientUrl
        ? JSON.stringify(parsedOptions.clientUrl)
        : parsedOptions.clientHostname
        ? `'//${parsedOptions.clientHostname}:${port}/livereload.js?snipver=1'`
        : process.env.CODESANDBOX_SSE
        ? `'//' + (self.location.hostname.replace(/^([^.]+)-\\d+/,"$1").replace(/^([^.]+)/, "$1-${port}")) + '/livereload.js?snipver=1&port=443'`
        : `(self.location.protocol.startsWith('http') ? '' : 'http:') + '//' + (self.location.hostname || 'localhost') + ':${port}/livereload.js?snipver=1'`
      return `(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = ${snippetSrc}; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);`
    },
    async generateBundle() {
      if (!enabled) {
        enabled = true
        const port = await portPromise
        const customPort = port !== 35729 ? ' on port ' + port : ''
        console.log(green('LiveReload enabled' + customPort))
      }
    },
  }
}

function parseOptions(
  options: RollupLivereloadOptions | string
): RollupLivereloadOptions {
  if (typeof options === 'string') {
    return {
      watch: options,
    }
  }

  return options
}

function green(text: string) {
  return '\u001b[1m\u001b[32m' + text + '\u001b[39m\u001b[22m'
}


================================================
FILE: test/config/entry.js
================================================
window.onload = () =>
  (document.body.innerHTML +=
    '<br>Path: ' + window.location.pathname + '<br>Date: ' + Date.now())


================================================
FILE: test/config/index.html
================================================
<head>
  <title>test</title>
</head>
<script src="dest.js"></script>


================================================
FILE: test/config/rollup.config.js
================================================
import serve from 'rollup-plugin-serve'
import livereload from '../../dist/index.js'

export default {
  input: 'entry.js',
  output: {
    file: 'dest.js',
    format: 'cjs',
  },
  plugins: [
    serve({ contentBase: '', port: Math.round(Math.random() * 10000) + 40000 }),
    livereload(),
  ],
}


================================================
FILE: test/config.test.ts
================================================
import { afterAll, beforeAll, describe, expect, vi } from 'vitest'
import { appendFileSync, readFileSync, writeFileSync } from 'node:fs'
import { DELAY, createContext } from './shared'

const FILE_TO_MODIFY = 'test/config/rollup.config.js'

describe('config update', test => {
  let ctx = createContext('config')
  let originalFile: string
  beforeAll(() => {
    originalFile = readFileSync(FILE_TO_MODIFY, 'utf-8')
  })

  test('should trigger a reload', async t => {
    expect(ctx.reload).toHaveBeenCalledTimes(0)

    // Update the config file and check if it reloads
    appendFileSync(FILE_TO_MODIFY, '\nconsole.log("append")')
    await new Promise(resolve => setTimeout(resolve, 1000 + DELAY))
    expect(ctx.reload).toHaveBeenCalledWith(
      expect.stringContaining('rollup.config.js')
    )
    expect(ctx.reload).toHaveBeenCalledTimes(1)
  })

  afterAll(() => {
    writeFileSync(FILE_TO_MODIFY, originalFile, 'utf-8')
  })
})


================================================
FILE: test/entry/entry.js
================================================
window.onload = () =>
  (document.body.innerHTML +=
    '<br>Path: ' + window.location.pathname + '<br>Date: ' + Date.now())


================================================
FILE: test/entry/index.html
================================================
<head>
  <title>test</title>
</head>
<script src="dest.js"></script>


================================================
FILE: test/entry/rollup.config.js
================================================
import serve from 'rollup-plugin-serve'
import livereload from '../../dist/index.js'

export default {
  input: 'entry.js',
  output: {
    file: 'dest.js',
    format: 'cjs',
  },
  plugins: [
    serve({ contentBase: '', port: Math.round(Math.random() * 10000) + 40000 }),
    livereload(),
  ],
}


================================================
FILE: test/entry.test.ts
================================================
import { afterAll, beforeAll, describe, expect, vi } from 'vitest'
import { appendFileSync, readFileSync, writeFileSync } from 'node:fs'
import { DELAY, createContext } from './shared'

const FILE_TO_MODIFY = 'test/entry/entry.js'

describe('entry update', test => {
  let ctx = createContext('entry')
  let originalFile: string
  beforeAll(() => {
    originalFile = readFileSync(FILE_TO_MODIFY, 'utf-8')
  })
  test('should trigger a reload', async t => {
    expect(ctx.reload).toHaveBeenCalledTimes(0)

    // Update the entry file and check if it reloads
    appendFileSync(FILE_TO_MODIFY, '\nconsole.log("append")')
    await new Promise(resolve => setTimeout(resolve, DELAY))
    // since livereload is watching the entire folder, it will send two reload
    // commands, one for the entry file and one for the bundle.
    expect(ctx.reload).toHaveBeenNthCalledWith(
      1,
      expect.stringContaining('entry.js')
    )
    expect(ctx.reload).toHaveBeenNthCalledWith(
      2,
      expect.stringContaining('dest.js')
    )
    // Update the entry file and check if it reloads
    appendFileSync(FILE_TO_MODIFY, '\nconsole.log("append")')
    await new Promise(resolve => setTimeout(resolve, DELAY))
    expect(ctx.reload).toHaveBeenNthCalledWith(
      3,
      expect.stringContaining('entry.js')
    )
    expect(ctx.reload).toHaveBeenNthCalledWith(
      4,
      expect.stringContaining('dest.js')
    )
    expect(ctx.reload).toHaveBeenCalledTimes(4)
  })

  afterAll(() => {
    writeFileSync(FILE_TO_MODIFY, originalFile, 'utf-8')
  })
})


================================================
FILE: test/shared.ts
================================================
import { ChildProcessWithoutNullStreams, spawn } from 'node:child_process'
import WebSocket from 'ws'
import { afterAll, beforeAll, vi } from 'vitest'

export const DELAY = 400

export function createContext(folder = 'entry') {
  const start = performance.now()
  const ctx = {
    url: '',
    server: null as unknown as ChildProcessWithoutNullStreams,
    client: null as unknown as WebSocket,
    reload: (path: string) => {},
  }

  beforeAll(async () => {
    ctx.server = spawn('rollup', ['-cw'], { cwd: 'test/' + folder })
    const serving = await new Promise(resolve => {
      let created = false
      let live = false
      ctx.server.stdout.on('data', data => {
        const line = data.toString().trim()
        if (line.split(' -> ').length > 1 && line.startsWith('http')) {
          ctx.url = line.split(' -> ')[0]
        }
        if (line.includes('LiveReload enabled')) {
          live = true
          if (created && live) resolve(true)
        }
      })
      ctx.server.stderr.on('data', data => {
        if (data.toString().trim().includes('created')) created = true
        if (created && live) resolve(true)
      })
    })

    await new Promise(resolve => {
      const client = (ctx.client = new WebSocket('ws://localhost:35729'))
      client.addEventListener('open', () => {
        client.send(
          '{"command":"hello","protocols":["http://livereload.com/protocols/official-6","http://livereload.com/protocols/official-7"],"ver":"3.3.2","snipver":1}'
        )
        resolve(true)
      })
      client.addEventListener('message', evt => {
        const data = JSON.parse(evt.data.toString())
        if (data.command === 'hello') {
          client.send(JSON.stringify({ command: 'info', url: ctx.url + '/' }))
          resolve(client)
        }
        if (data.command === 'reload') {
          ctx.reload(data.path)
        }
      })
    })

    ctx.reload = vi.fn((path: string) => {})
  })

  afterAll(() => {
    ctx.client?.close()
    ctx.server.kill()
  })

  return ctx
}


================================================
FILE: tsconfig.json
================================================
{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "Node",
    "strict": true
  }
}
Download .txt
gitextract_mtf7ex3r/

├── .github/
│   └── workflows/
│       └── pr.yml
├── .gitignore
├── .prettierrc
├── CHANGELOG.md
├── LICENSE.md
├── README.md
├── package.json
├── src/
│   └── index.ts
├── test/
│   ├── config/
│   │   ├── entry.js
│   │   ├── index.html
│   │   └── rollup.config.js
│   ├── config.test.ts
│   ├── entry/
│   │   ├── entry.js
│   │   ├── index.html
│   │   └── rollup.config.js
│   ├── entry.test.ts
│   └── shared.ts
└── tsconfig.json
Download .txt
SYMBOL INDEX (8 symbols across 4 files)

FILE: src/index.ts
  type RollupLivereloadOptions (line 22) | interface RollupLivereloadOptions extends CreateServerConfig {
  function livereload (line 58) | function livereload(
  function parseOptions (line 112) | function parseOptions(
  function green (line 124) | function green(text: string) {

FILE: test/config.test.ts
  constant FILE_TO_MODIFY (line 5) | const FILE_TO_MODIFY = 'test/config/rollup.config.js'

FILE: test/entry.test.ts
  constant FILE_TO_MODIFY (line 5) | const FILE_TO_MODIFY = 'test/entry/entry.js'

FILE: test/shared.ts
  constant DELAY (line 5) | const DELAY = 400
  function createContext (line 7) | function createContext(folder = 'entry') {
Condensed preview — 18 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (19K chars).
[
  {
    "path": ".github/workflows/pr.yml",
    "chars": 293,
    "preview": "name: Test\non: push\njobs:\n  test:\n    name: Run tests\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checko"
  },
  {
    "path": ".gitignore",
    "chars": 135,
    "preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\n\n# Dependency directory\nnode_modules\n\n# Unwanted\n.idea\n.DS_Store\n\n# Build files\ndist/*\n"
  },
  {
    "path": ".prettierrc",
    "chars": 95,
    "preview": "{\n  \"arrowParens\": \"avoid\",\n  \"semi\": false,\n  \"singleQuote\": true,\n  \"trailingComma\": \"es5\"\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 1452,
    "preview": "# Changelog\n\nAll notable changes to `rollup-plugin-livereload` will be documented in this file.\n\n## [Unreleased]\n\n## [2."
  },
  {
    "path": "LICENSE.md",
    "chars": 1081,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2016 Thomas Ghysels\n\nPermission is hereby granted, free of charge, to any person ob"
  },
  {
    "path": "README.md",
    "chars": 3013,
    "preview": "# Rollup plugin LiveReload\n\n<a href=\"LICENSE\">\n  <img src=\"https://img.shields.io/badge/license-MIT-brightgreen.svg\" alt"
  },
  {
    "path": "package.json",
    "chars": 1586,
    "preview": "{\n  \"name\": \"rollup-plugin-livereload\",\n  \"version\": \"2.0.5\",\n  \"description\": \"Rollup plugin for LiveReload that watche"
  },
  {
    "path": "src/index.ts",
    "chars": 3601,
    "preview": "import {\n  createServer,\n  type LiveReloadServer,\n  type CreateServerConfig,\n} from 'livereload'\nimport { resolve } from"
  },
  {
    "path": "test/config/entry.js",
    "chars": 125,
    "preview": "window.onload = () =>\n  (document.body.innerHTML +=\n    '<br>Path: ' + window.location.pathname + '<br>Date: ' + Date.no"
  },
  {
    "path": "test/config/index.html",
    "chars": 69,
    "preview": "<head>\n  <title>test</title>\n</head>\n<script src=\"dest.js\"></script>\n"
  },
  {
    "path": "test/config/rollup.config.js",
    "chars": 300,
    "preview": "import serve from 'rollup-plugin-serve'\nimport livereload from '../../dist/index.js'\n\nexport default {\n  input: 'entry.j"
  },
  {
    "path": "test/config.test.ts",
    "chars": 942,
    "preview": "import { afterAll, beforeAll, describe, expect, vi } from 'vitest'\nimport { appendFileSync, readFileSync, writeFileSync "
  },
  {
    "path": "test/entry/entry.js",
    "chars": 125,
    "preview": "window.onload = () =>\n  (document.body.innerHTML +=\n    '<br>Path: ' + window.location.pathname + '<br>Date: ' + Date.no"
  },
  {
    "path": "test/entry/index.html",
    "chars": 69,
    "preview": "<head>\n  <title>test</title>\n</head>\n<script src=\"dest.js\"></script>\n"
  },
  {
    "path": "test/entry/rollup.config.js",
    "chars": 300,
    "preview": "import serve from 'rollup-plugin-serve'\nimport livereload from '../../dist/index.js'\n\nexport default {\n  input: 'entry.j"
  },
  {
    "path": "test/entry.test.ts",
    "chars": 1558,
    "preview": "import { afterAll, beforeAll, describe, expect, vi } from 'vitest'\nimport { appendFileSync, readFileSync, writeFileSync "
  },
  {
    "path": "test/shared.ts",
    "chars": 2030,
    "preview": "import { ChildProcessWithoutNullStreams, spawn } from 'node:child_process'\nimport WebSocket from 'ws'\nimport { afterAll,"
  },
  {
    "path": "tsconfig.json",
    "chars": 130,
    "preview": "{\n  \"compilerOptions\": {\n    \"target\": \"ESNext\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"Node\",\n    \"strict\": t"
  }
]

About this extraction

This page contains the full source code of the thgh/rollup-plugin-livereload GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 18 files (16.5 KB), approximately 5.1k tokens, and a symbol index with 8 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!