Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/btmorex/rollup-plugin-make
Rollup plugin to build dependency files suitable for make
https://github.com/btmorex/rollup-plugin-make
Last synced: 3 months ago
JSON representation
Rollup plugin to build dependency files suitable for make
- Host: GitHub
- URL: https://github.com/btmorex/rollup-plugin-make
- Owner: btmorex
- Created: 2017-06-22T21:15:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-05T23:56:08.000Z (over 6 years ago)
- Last Synced: 2024-07-04T15:46:19.644Z (4 months ago)
- Language: JavaScript
- Size: 23.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - make - Build dependency files suitable for make. (Plugins / Workflow)
README
# rollup-plugin-make
Rollup plugin to build dependency files suitable for make
## Options
- `mangle`: [Default: `output.file` with existing extension replaced by `.d`] A function that will be passed `output.file` and should return the file to write dependencies to.
## Example
Suppose a make rule builds `dist/script/*` from `script/*`. With an input of `script/app.js`, the plugin will write dependencies to `dist/script/app.d` by default. In the example below, dependencies will instead be written to `dist/.dep/script/app.d`:
```javascript
import make from 'rollup-plugin-make';
import path from 'path';export default {
...
plugins: [
...
make({
mangle: (file) => {
const outputStem = 'dist/';
const input = file.replace(outputStem, '');
const inputDep = `${input.substring(0, input.lastIndexOf('.'))}.d`;
return path.join(outputStem, '.dep', inputDep);
},
}),
],
};
```