Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tknf/parcel-transformer-edge
Parcel v2 transformer plugin for Edge template.
https://github.com/tknf/parcel-transformer-edge
html javascript parcel template-engine
Last synced: 8 days ago
JSON representation
Parcel v2 transformer plugin for Edge template.
- Host: GitHub
- URL: https://github.com/tknf/parcel-transformer-edge
- Owner: tknf
- License: mit
- Created: 2022-03-09T18:02:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-03-12T05:01:55.000Z (over 2 years ago)
- Last Synced: 2024-10-25T05:27:05.138Z (21 days ago)
- Topics: html, javascript, parcel, template-engine
- Language: JavaScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# parcel-transformer-edge
Parcel v2 transformer plugin for Edge template.## Installation
```sh
npm i -D parcel-transformer-edge
# or
yarn add -D parcel-transformer-edge
```## Configuration
```json
{
"extends": ["@parcel/config-default"],
"transformers": {
"*.edge": ["parcel-transformer-edge"]
}
}
```Reference [Parcel plugin configuration](https://v2.parceljs.org/configuration/plugin-configuration/)
## Customization
You can add custom options for Edge templating engine using a `.edgerc.js`, `edge.config.js` file.### Set views directory
You can register a path to directory for finding the Edge templates.
Default: `views`configuration:
```js
module.exports = {
views: "src"
}
```in template:
```html```
in root:
```html
@include("partials/header")
```### Register template state
configuration:
```js
module.exports = {
state: {
author: {
name: "Bob",
age: 24
}
}
};
```in template:
```html{{ author.name }}
```Result:
```htmlBob
```### Register template
configuration:
```js
module.exports = {
templates: {
button: {
template: `
{{ title }}
`
}
}
};
```in template:
```html
@!component("button", {
title: "Hello!",
class: ["Button", "Button--primary"]
})
```Result:
```html
Hello!
```## Edge documentation
For more information on Edge template, see [AdonisJS website](https://docs.adonisjs.com/guides/views/rendering).
## License
MIT