F-loat / vue-simplemde

📝 Vue SimpleMDE - use simplemde with vue.js
https://F-loat.github.io/vue-simplemde/dist/demo.html
MIT License
769 stars 111 forks source link

Use easyMDE instead of no-longer maintained simpleMDE #55

Closed adamJLev closed 6 years ago

adamJLev commented 6 years ago

Hi there,

First of all thanks for your work, this project has helped me a lot in getting things built fast.

There's a new "official fork" of simpleMDE called easyMDE: https://github.com/ionaru/easy-markdown-editor. simpleMDE hasn't been updated in over 2 years now and has a lot of issues: https://github.com/sparksuite/simplemde-markdown-editor/issues

The libs are compatible, so it shouldn't be too much work. Mainly we would just need to make this import be optional or let the user pass in an instance of "MDE" via config: https://github.com/F-loat/vue-simplemde/blob/master/src/markdown-editor.vue#L8

Or maybe you have a better idea, what do you think?

Thanks!

F-loat commented 6 years ago

Hey, to do this you can just add webpack alias and replace the css import.

resolve: {
  extensions: ['.js', '.vue', '.json'],
  alias: {
    '@': resolve('src'),
    'simplemde': 'easymde',
  }
},
@import '~easymde/dist/easymde.min.css';
Nielson commented 6 years ago

Hi @F-loat !

I'm not yet that familiar with webpack config. Where exactly do I have to do this? So far I guess I have to edit the file /node_modules/vue-simplemde/webpack.config.js?

Would I have to edit the code below or add a new one and how will this take effect after editing? :)

resolve: { alias: { 'vue$': 'vue/dist/vue.esm.js' } },

Thanks and sorry for bothering you with that might be a simple question :)

F-loat commented 5 years ago
resolve: {
  alias: {
    'vue$': 'vue/dist/vue.esm.js',
    'simplemde': 'easymde'
  }
},

import simplemde will get easymde. [doc]

Nielson commented 5 years ago

Ah, thanks!

simshaun commented 5 years ago

For anybody using the Vue cli, you can create a vue.config.js file in your project root with:

module.exports = {
  configureWebpack: {
    resolve: {
      alias: {
        simplemde: 'easymde',
      },
    },
  },
};

Restart Webpack and it should work.

As an aside, I do think it would be good for this lib to use an editor that's kept up to date, but as long as EasyMDE is kept compatible I guess it's not a big deal.

kolaente commented 4 years ago

simplemde hasn't been updated since almost 4 years. IMHO switching this project to easymde would be a good idea...

F-loat commented 4 years ago

https://github.com/NikulinIlya/vue-easymde a workaround with easymde.

kolaente commented 4 years ago

@F-loat Yes, but as you said: It's a workaround.