1.0.2 • Published 1 year ago

vue-cli-plugin-coffee v1.0.2

Weekly downloads
81
License
MIT
Repository
github
Last release
1 year ago

vue-cli-plugin-coffee

CoffeeScript2 support for the projects created with @vue/cli.

With built-in:

  • cache-loader
  • thread-loader
  • babel-loader

Installation

According to this you are able to install community plugins as follows:

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.

# ONLY if you don't need eslint
npm remove @vue/cli-plugin-eslint

Common usage

Usually you write SFC like this

<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 you can add entries using your vue.config.js like so:

// 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:

<script lang="coffee" type="text/coffeescript">
  console.log "This code is ignored by eslint, but executed by the coffeescript compiler"
</script>
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

3 years ago

0.5.13

4 years ago

0.5.12

4 years ago

0.5.11

4 years ago

0.5.10

4 years ago

0.5.9

4 years ago

0.5.8

4 years ago

0.5.7

4 years ago

0.5.4

4 years ago

0.5.6

4 years ago

0.5.5

4 years ago

0.5.3

4 years ago

0.5.0

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.4.0

4 years ago

0.3.1

4 years ago

0.2.2

4 years ago

0.1.0

5 years ago