WebPack + CodeMirror + LoadMode
See original GitHub issueHello!
I’m trying to use Codemirror with LoadMode alongside with WebPack. I thought about having something like:
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../node_modules/codemirror/mode/*/*'),
to: path.join(config.build.assetsSubDirectory, 'js/codemirror/mode/[name]/[name].js')
}
and then have the CodeMirror to auto load the files but I can’t get it to work. When I import ‘loadmodule’ I get this warning and it doesn’t seem to be working:
warning in ./~/codemirror/addon/mode/loadmode.js
51:6-19 Critical dependency: the request of a dependency is an expression
This is my import section of the file:
import 'codemirror/addons/mode/loadmodule'
import CodeMirror from 'codemirror'
I can use Codemirror and the themes. I’m not just being able to load the modes dynamically and I didn’t want to import them at once.
How do I plug loadmode into CodeMirror?
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
WebPack + CodeMirror + LoadMode · Issue #4838 - GitHub
Hello! I'm trying to use Codemirror with LoadMode alongside with WebPack. I thought about having something like: new CopyWebpackPlugin([ ...
Read more >[Help] Running into loader-related issue when trying to use ...
My project is using React, so I am using the codemirror and ... See https://webpack.js.org/concepts#loaders | /* BASICS */ | > .
Read more >Vue-codemirror-component NPM | npm.io
Check Vue-codemirror-component 1.1.1 package - Last release 1.1.1 at our NPM packages aggregator and ... Install webpack, css-loader and style-loader.
Read more >Make codemirror-mode-elixir work : UP-8614 - YouTrack
Issue was created from an Upsource discussion in file loadmode-webpack.js in review UP-CR-1062, revision a816d77. Leonid Khachaturov wrote on 10 Mar 2017 ...
Read more >Add grunt task for building new CodeMirror bundles from ...
Use webpack to build codemirror.js from manifest based on ... and the issue prevents being able to add Modes, even via the included...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So I created something like a wrapper around CodeMirror and instead of importing CodeMirror directly, I import this file:
Hey @tony! I’m using it on this project. It’s all open source.