https://github.com/bwin/coffee-in-vue-templates-loader
Webpack-loader to use coffeescript in vue templates as attributes or interpolations.
https://github.com/bwin/coffee-in-vue-templates-loader
coffeescript vue
Last synced: 3 months ago
JSON representation
Webpack-loader to use coffeescript in vue templates as attributes or interpolations.
- Host: GitHub
- URL: https://github.com/bwin/coffee-in-vue-templates-loader
- Owner: bwin
- License: mit
- Created: 2019-06-08T15:12:10.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:53:28.000Z (over 3 years ago)
- Last Synced: 2025-03-14T02:41:48.222Z (over 1 year ago)
- Topics: coffeescript, vue
- Language: CoffeeScript
- Size: 595 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# coffee-in-vue-templates-loader [CIVTL]
| Webpack-loader to use coffeescript in vue templates as attributes or interpolations.
- [Installation](#installation)
- [Example usage](#example-usage)
- [Webpack configuration](#webpack-configuration)
- [With nuxt](#with-nuxt)
## Installation
```sh
yarn add --dev coffee-in-vue-templates-loader
```
## Example usage
### Example usage with `pug` (as intended):
```vue
div(:class="active: i is 2" @click="fn item, something: yes") {{ $t 'buttons.ok' }}
```
### Same example with just html:
```vue
{{ $t 'buttons.ok' }}
```
### Both would get transpiled to:
```vue
{{ $t('buttons.ok') }}
```
## Webpack configuration
### With `nuxt`
For example to use with `pug`, put the following in `nuxt.config.coffee`:
```coffee
[...]
build:
extend: (config, ctx) ->
config.module.rules.push
test: /\.pug$/
use: ['coffee-in-vue-templates-loader', 'pug-plain-loader']
```