Skip to content

Modes cannot be imported in bundler #25

@tpluscode

Description

@tpluscode

I want to use wc-codemirror with webpack and it's not possible to import a mode

import '@vanillawc/wc-codemirror/mode/javascript/javascript.js'

This fails because the original source tries to require('../../lib/codemirror').

While I would not like to modify all those mode modules, I propose to create dummy commonjs (sic!) module at that path so that webpack and possibly other bundler can import do their thing

It can be simply

module.exports = window.CodeMirror

Ugly but it works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions