SimulatedGREG/vue-electron

problem with importing codemirror

bwiercinski opened this issue · 1 comments

hello
I'm struggling with problem. I want to use this template with codemirror library. I have created clean project and everything I've done is replacing LandingPage.vue file with following content:

<template>
    <div id="wrapper">
        <textarea ref="ed" id="editor">
import someResource from 'codemirror/some-resource'
export default {
  data () {
    return {
      exampleCode: 'const a = 10'
  }
}
        </textarea>
    </div>
</template>

<script>
    /* eslint-disable */
    import CodeMirror from 'codemirror'
    import 'codemirror/mode/javascript/javascript.js'
    import 'codemirror/lib/codemirror.css'
    import 'codemirror/theme/monokai.css'

    export default {
        name: 'landing-page',
        mounted: function () {
            CodeMirror.fromTextArea(document.getElementById('editor'), {
                lineNumbers: true,
                mode: 'text/javascript',
                theme: 'monokai'
            });
        }
    }
</script>

but javascript coloring scheme seems to not import

when i remove 2 first lines of imports and add to index.ejs this:

<script src="node_modules/codemirror/lib/codemirror.js"></script>
<script src="node_modules/codemirror/mode/javascript/javascript.js"></script>

it starts to working but of course it's not my solution.

I thing its some problem in webpack confing.

Maybe sourcecode of codemirror/mode/javascript/javascript.js will help

bw

sorry wrong repo