vue-styleguidist / vue-cli-plugin-styleguidist

vue cli 3.0 plugin for vue-styleguidist
MIT License
21 stars 6 forks source link

vue cli with Typescript and without class-style component is not working #24

Closed ChristianStornowski closed 5 years ago

ChristianStornowski commented 5 years ago

This plugin don't work with a Typescript vue cli project.

You can reproduce the problem via those steps:

  1. npx -p @vue/cli vue create test
  2. select Typescript without class-style component
  3. npx -p @vue/cli vue add styleguidist
  4. npm run styleguide

=>

./node_modules/react-styleguidist/lib/rsg-components/Editor/EditorLoader.js 36:3
Module parse failed: 'import' and 'export' may only appear at the top level (36:3)
You may need an appropriate loader to handle this file type.
|           var _this2 = this;
| 
>           import('rsg-components/Editor/Editor').then(function (module) {
|               _this2.setState({ editor: module.default });
|           });
 @ ./node_modules/react-styleguidist/lib/rsg-components/Editor/index.js 1:0-61 1:0-61
 @ ./node_modules/react-styleguidist/lib/rsg-components/slots/index.js
 @ ./node_modules/vue-styleguidist/lib/utils/renderStyleguide.js
 @ ./node_modules/vue-styleguidist/lib/index.js
 @ multi ./node_modules/vue-styleguidist/lib/index ./node_modules/react-dev-utils/webpackHotDevClient.js
elevatebart commented 5 years ago

Thanks, I’ll be looking into it this week

elevatebart commented 5 years ago

Did you select anything specific regarding babel ? What OS are you using? I still have some issues with Windows and component folder casing.

ChristianStornowski commented 5 years ago

I selected babel and typescript in combination (a standard choice from the vue creating wizard) for getting polyfill from babel and transcompilation from Typescript. My OS is Ubuntu 18.04.

elevatebart commented 5 years ago

THank you for the quick response. I will check it out now.

elevatebart commented 5 years ago

Just to be sure, have you tryed with version 0.2.0 or 0.1.12 ?

ChristianStornowski commented 5 years ago

I tested vue-cli-plugin-styleguidist with the same steps on another system (OS OpenSuse tumbleweed). I was looking at the package.json. Version ^0.2.0.

Now it's running. :-? :-)

Could it be possbile that i was using Version 0.1.12 6 hours ago because this command npx -p @vue/cli vue add styleguidist has no version for styleguidist. I can't tell you that. For now it's working. :-)

elevatebart commented 5 years ago

Yep ! I released 0.2.0 early this morning, so you could have ;)

No problem!