chmln / vue-wysiwyg

A lightweight WYSIWYG HTML editor for Vue.js
https://chmln.github.io/vue-wysiwyg/
MIT License
561 stars 137 forks source link

Pre-compile files to ES5 #2

Closed petarjs closed 7 years ago

petarjs commented 7 years ago

Cool package!

I tried using it with https://github.com/vuejs-templates/webpack boilerplate, but get this error when I include it into the project:

Uncaught SyntaxError: Unexpected token import

Which happens at src/index.js 1st line import statement.
It's because the package doesn't offer built dist files - the package.json has defined

"main": "src/index.js"

which is in ES6. The thing is that most webpack configurations exclude node_modules from transpilation, and expect to find ES5 code, as it would be inefficient to transpile the whole node_modules on each build.

The solution would be to offer the compiled library, such as dist/vue-wysiwyg.js, and add that file into the "main" propery of "package.json". Here are some issues that talk about similar problems:

https://github.com/charliekassel/vuejs-datepicker/issues/15 https://github.com/matfish2/vue-stripe/pull/3

Thanks!

chmln commented 7 years ago

Hello,

Yes, I've encountered some issues as well depending on the webpack config. Pre-compiled versions will be provided very soon.

Thanks for reporting the issue :+1:

defaye commented 7 years ago

Is this fixed?