-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use import instead of multi-entry plugin
- Loading branch information
Showing
6 changed files
with
50 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import StringStream from "../../util/StringStream.js" | ||
import * as modeMethods from "../../modes.js" | ||
|
||
// Create a minimal CodeMirror needed to use runMode, and assign to root. | ||
var root = typeof globalThis !== 'undefined' ? globalThis : window | ||
root.CodeMirror = {} | ||
|
||
// Copy StringStream and mode methods into CodeMirror object. | ||
CodeMirror.StringStream = StringStream | ||
for (var exported in modeMethods) CodeMirror[exported] = modeMethods[exported] | ||
|
||
// Minimal default mode. | ||
CodeMirror.defineMode("null", () => ({token: stream => stream.skipToEnd()})) | ||
CodeMirror.defineMIME("text/plain", "null") | ||
|
||
CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min | ||
CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/); } | ||
|
||
CodeMirror.defaults = { indentUnit: 2 } | ||
export default CodeMirror; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import StringStream from "../../util/StringStream.js" | ||
import * as modeMethods from "../../modes.js" | ||
|
||
// Copy StringStream and mode methods into exports (CodeMirror) object. | ||
exports.StringStream = StringStream | ||
for (var exported in modeMethods) exports[exported] = modeMethods[exported] | ||
|
||
// Shim library CodeMirror with the minimal CodeMirror defined above. | ||
require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")] | ||
require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")] | ||
|
||
// Minimal default mode. | ||
exports.defineMode("null", () => ({token: stream => stream.skipToEnd()})) | ||
exports.defineMIME("text/plain", "null") | ||
|
||
exports.registerHelper = exports.registerGlobalHelper = Math.min | ||
exports.splitLines = function(string) { return string.split(/\r?\n|\r/); } | ||
|
||
exports.defaults = { indentUnit: 2 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,2 @@ | ||
import StringStream from "../../util/StringStream.js" | ||
import * as modeMethods from "../../modes.js" | ||
|
||
// Create a minimal CodeMirror needed to use runMode, and assign to root. | ||
var root = typeof globalThis !== 'undefined' ? globalThis : window | ||
root.CodeMirror = {} | ||
|
||
// Copy StringStream and mode methods into CodeMirror object. | ||
CodeMirror.StringStream = StringStream | ||
for (var exported in modeMethods) CodeMirror[exported] = modeMethods[exported] | ||
|
||
// Minimal default mode. | ||
CodeMirror.defineMode("null", () => ({token: stream => stream.skipToEnd()})) | ||
CodeMirror.defineMIME("text/plain", "null") | ||
|
||
CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min | ||
CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/); } | ||
|
||
CodeMirror.defaults = { indentUnit: 2 } | ||
import CodeMirror from "./codemirror-standalone.js" | ||
import "../../../addon/runmode/runmode.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,2 @@ | ||
import StringStream from "../../util/StringStream.js" | ||
import * as modeMethods from "../../modes.js" | ||
|
||
// Copy StringStream and mode methods into exports (CodeMirror) object. | ||
exports.StringStream = StringStream | ||
for (var exported in modeMethods) exports[exported] = modeMethods[exported] | ||
|
||
// Shim library CodeMirror with the minimal CodeMirror defined above. | ||
require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")] | ||
require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")] | ||
|
||
// Minimal default mode. | ||
exports.defineMode("null", () => ({token: stream => stream.skipToEnd()})) | ||
exports.defineMIME("text/plain", "null") | ||
|
||
exports.registerHelper = exports.registerGlobalHelper = Math.min | ||
exports.splitLines = function(string) { return string.split(/\r?\n|\r/); } | ||
|
||
exports.defaults = { indentUnit: 2 } | ||
import "./codemirror.node.js" | ||
import "../../../addon/runmode/runmode.js" |