Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jlocoding/rollup-plugin-import-file
A rollup plugin that allows you to import any file type in your project
https://github.com/jlocoding/rollup-plugin-import-file
Last synced: about 2 months ago
JSON representation
A rollup plugin that allows you to import any file type in your project
- Host: GitHub
- URL: https://github.com/jlocoding/rollup-plugin-import-file
- Owner: jlocoding
- License: mit
- Created: 2019-02-21T14:01:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-11T11:26:34.000Z (3 months ago)
- Last Synced: 2024-07-22T06:33:56.923Z (2 months ago)
- Language: JavaScript
- Size: 344 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rollup-plugin-import-file
A rollup plugin that allows you to import any file type in your project
## Installation
npm install --save-dev rollup-plugin-import-file
## Usage
Add plugin to your rollup.config.js:
```JavaScript
import files from 'rollup-plugin-import-file';export default {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
name: 'bundle.js',
format: 'umd',
},
plugins: [
files({
output: 'dist/assets/files',
extensions: /\.(wav|doc)$/,
hash: true,
}),
]
};
```## Options
Here are the options:
- output: Required. The destination path of the output files.
- extensions: Required. Accepted extensions. E.g. /\.(wav|docx)$/
- hash: Optional. Default as false. If it sets to true, a generated hash key will append to the original file name.## License
MIT