rollup-preserve-directives
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

rollup-preserve-directives

A rollup plugin helps preserving shebang and string directives in your code.

Install

npm install rollup-preserve-directives

Usage

import preserveDirectives from 'rollup-preserve-directives'

export default {
  input: './src/index.js',
  output: {
    file: './dist/index.js',
    format: 'cjs'
  },
  plugins: [
    preserveDirectives()
  ]
}

Inter-plugin-communication

This plugin exposes the result of its directives information of current file for other plugins to use. You can access it via this.getModuleInfo or the moduleParsed hook.

// `meta` property info
{
  preserveDirectives: {
    directives: string[]
    shebang: string
  }
}

License

MIT

Package Sidebar

Install

npm i rollup-preserve-directives

Weekly Downloads

16,866

Version

1.1.1

License

MIT

Unpacked Size

18.4 kB

Total Files

7

Last publish

Collaborators

  • huozhi
  • sukkaw