This package has been deprecated

Author message:

Project was renamed. Use rollup-plugin-rebase instead. Same code, different name.

rollup-plugin-relink

0.3.1 • Public • Published

Rollup Relink
Sponsored by Version Downloads Build Status Unix Build Status Windows Dependencies

The Rollup Relink Plugin copies static assets as required from your JavaScript code to the destination folder and adjusts the references in there to point to the new location.

The plugin is meant as a tool for preparing a library for being published. In this it differs from plugins like Rollup URL Plugin as it is designed for usage in libraries and not for applications. The output of this plugin can be used by tools like Webpacks File Loader, URL Loader or the already mentioned Rollup URL Plugin.

Features

  • Copies over asset files references from JavaScript into the given output folder.
  • Adjust asset references in the output JavaScript files to map to the relative new location.
  • Transforms CSS files to inline all includes from @import via PostCSS Smart Import into the origin files.
  • Renames all assets based on their hash (SHA256 + Base62) so that conflicts are automatically eliminated while producing a flat zero depth output structure.
  • Supports normal CSS, but also SugarSS and SCSS via the standard PostCSS parser plugins.
  • Processes all files which do not match this extension list: .json, .jsx, .js, .es, .es5, .es6, .vue.

Links

Installation

$ npm install --save-dev rollup-plugin-relink

Usage

Rollup Relink comes with a binary which can be called from within your scripts section in the package.json file.

import relinkPlugin from "rollup-plugin-relink"
 
const outputFolder = "./lib";
const relink = relinkPlugin({ outputFolder })
 
rollup({
  entry: entry,
  ...
  external: relink.isExternal,
  ...
  plugins: [
    ...
    relink
  ]
})
.then((bundle) =>
  bundle.write({
    ...
    dest: `${outputFolder}/index.js`
  })
)

Contributing

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests ($ npm test).

License

Copyright

Sebastian Software GmbH Logo

Copyright 2016
Sebastian Software GmbH

Package Sidebar

Install

npm i rollup-plugin-relink

Weekly Downloads

0

Version

0.3.1

License

MIT

Last publish

Collaborators

  • swernerx