https://github.com/jsreport/jsreport-static-resources
jsreport extension serving static scripts and styles like jquery or bootstrap from the pre-configured directory.
https://github.com/jsreport/jsreport-static-resources
Last synced: about 1 year ago
JSON representation
jsreport extension serving static scripts and styles like jquery or bootstrap from the pre-configured directory.
- Host: GitHub
- URL: https://github.com/jsreport/jsreport-static-resources
- Owner: jsreport
- License: mit
- Created: 2015-10-20T08:21:21.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-21T16:56:23.000Z (about 9 years ago)
- Last Synced: 2025-03-27T11:43:35.147Z (about 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 3
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsreport-static-resources
[](https://npmjs.com/package/jsreport-static-resources)
> **!!! Please use [assets](https://jsreport.net/learn/assets) extension which solves the static resources referencing in better way instead**
**[jsreport](https://github.com/jsreport/jsreport) extension serving static scripts and styles like jquery or bootstrap from the pre-configured directory.**
1.
```
npm install jsreport-static-resources
```
2.
Copy the scripts, styles or other static resources to the jsreport data directory `data\staticResources`
3.
Reference resources inside the template content using `$staticResources` property provided to the templating engine.
```html
...
```
4.
Optionally override the path to the static resources directory inside the jsreport configuration
```js
{
...
'static-resources': {
'directory': 'c:\build'
}
...
}
```
## jsreport-core
You can apply this extension also manually to [jsreport-core](https://github.com/jsreport/jsreport-core)
```js
var jsreport = require('jsreport-core')()
jsreport.use(require('jsreport-static-resources')())
```