# vue-cli-plugin-coffee

> CoffeeScript2 support for your @vue/cli project

Latest version **1.0.2** (published 2022-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-cli-plugin-coffee
pnpm add vue-cli-plugin-coffee
yarn add vue-cli-plugin-coffee
bun add vue-cli-plugin-coffee
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-10-20 |
| First published | 2018-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | ilovewindows96@gmail.com |
| Maintainers | cxspxr |
| Keywords | CoffeeScript2, "vue-cli", "vue", "vuejs", CoffeeScript, coffee |

## Links

- npm: https://www.npmjs.com/package/vue-cli-plugin-coffee
- Repository: https://github.com/artelydev/vue-cli-plugin-coffee
- Homepage: https://github.com/artelydev/vue-cli-plugin-coffee#readme
- Issues: https://github.com/artelydev/vue-cli-plugin-coffee/issues
- npm.io page: https://npm.io/package/vue-cli-plugin-coffee

## Dependencies (5)

- [@babel/core](https://npm.io/package/@babel/core.md) ^7.9.6
- [babel-loader](https://npm.io/package/babel-loader.md) ^8.1.0
- [cache-loader](https://npm.io/package/cache-loader.md) ^4.1.0
- [coffee-loader](https://npm.io/package/coffee-loader.md) ^1.0.0
- [thread-loader](https://npm.io/package/thread-loader.md) ^3.0.0

## Recent versions

- 1.0.2 (latest) — 2022-10-20
- 1.0.1 — 2022-10-20
- 1.0.0 — 2020-11-06
- 0.5.13 — 2020-08-17
- 0.5.12 — 2020-05-26
- 0.1.0 — 2018-09-29

## README

# vue-cli-plugin-coffee

CoffeeScript2 support for the projects created with [@vue/cli](https://github.com/vuejs/vue-cli).

With built-in:
* `cache-loader`
* `thread-loader`
* `babel-loader`

## Installation

According to [this](https://cli.vuejs.org/guide/plugins-and-presets.html#installing-plugins-in-an-existing-project) you are able to install community plugins as follows:

```shell
vue add coffee
```

__ESLINT Note__: Please visit "EsLint Integration" Section below on how to make this plugin work with eslint (else, it will return errors on coffeescript code).
If you don't need eslint, you can just uninstall it.
```shell
# ONLY if you don't need eslint
npm remove @vue/cli-plugin-eslint
```

## Common usage

Usually you write SFC like this

```vue
<template>
  <button @click="onclick">
    <slot></slot>
  </button>
</template>

<script lang="coffee">
  export default
    name: "Button"
    props:
      onclick:
        type: Function
        required: false
</script>
```

## Entries

According to [this](https://cli.vuejs.org/config/#configurewebpack) you can add entries using your `vue.config.js` like so:

```javascript
// vue.config.js
module.exports = {
  configureWebpack: {
    entry: {
      'new-entry': 'path/to/new/entry.coffee'
    }
  }
}

```

## Eslint Integration
If you're using ESLint, note that vue-loader uses `lang="coffee"` to identify components which are using Coffeescript, but `lang="coffee"` is not recognizable for ESLint. 

There are 2 ways on how you can make this plugin work with eslint:

1. __Coffeescript ESLint Support__  
https://github.com/helixbass/eslint-plugin-coffee

2. __Ignore Coffeescript Syntax__  
ESLint (following traditional HTML) uses `type="xxx"` to identify the type of scripts. As long as a `<script>` tag has any type other than javascript, ESLint would mark the script as non-javascript, and skips linting it. Coffeescript’s convention is to use `type="text/coffeescript"` to identify itself. Therefore, in your Vue components which are using Coffeescript, using both `lang` and `type` to avoid ESLint warnings.
Example:
```vue
<script lang="coffee" type="text/coffeescript">
  console.log "This code is ignored by eslint, but executed by the coffeescript compiler"
</script>
```

---
_Source: https://npm.io/package/vue-cli-plugin-coffee · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
