universal-vue / uvue

Vue CLI plugin to create universal Vue applications with ease
https://universal-vue.github.io/docs/
MIT License
127 stars 13 forks source link

Coffeescript support #56

Open phil294 opened 3 years ago

phil294 commented 3 years ago

Describe the bug Cannot read '$meta' of undefined. Seems very similar to #45.

To Reproduce I tried integrating UVue into a .coffee only repository (that is, no .js files present at all). The compilation step is baked into vue.config.js, and it all worked almost flawlessly and it's great. There is just one small drawback: main.js needs to be a Javascript file. If I keep it at main.coffee, I get the above error message.

For reproducing this, here is my CS compilation setup: *package.json*: ``` "coffee-loader": "^1.0.0", "coffeescript": "^2.5.1", ``` *vue.config.js*: ```chainWebpack: (config) => { config.resolve.extensions .add('.coffee') config.module .rule('coffee') .after('vue') .test(/\.coffee$/) .use('coffee/babel') .loader('babel-loader') .end() .use('coffee/loader') .loader('coffee-loader') .end() .end() ``` Alternatively, one could probably also just use `cxspxr/vue-cli-plugin-coffee`

Expected behavior No errors.

Additional context Changing uvue.config.js's paths.main to './src/main.coffee' does not help and only results in syntax errors.

This issue is probably low priority, as keeping the main file in Javascript is no great obstacle. But maybe this will help others with the same issue.

Thanks!

Please indicate versions of:

node: 11.15.0
vue-cli: 4.4.6
uvue: 0.17
os: Linux 5.8.18-1-MANJARO
browser: Chromium