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.
$ cnpm install rollup-plugin-relink
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.
@import via PostCSS Smart Import into the origin files..json, .jsx, .js, .es, .es5, .es6, .vue.$ npm install --save-dev rollup-plugin-relink
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`
})
)
$ npm test).Copyright 2016
Sebastian Software GmbH
Copyright 2013 - present © cnpmjs.org | Home |