-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9a5c34
commit 76d446e
Showing
1 changed file
with
55 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
diff --git a/node_modules/acorn-jsx/index.js b/node_modules/acorn-jsx/index.js | ||
index 004e080..84378b0 100644 | ||
--- a/node_modules/acorn-jsx/index.js | ||
+++ b/node_modules/acorn-jsx/index.js | ||
@@ -1,6 +1,7 @@ | ||
'use strict'; | ||
|
||
-const XHTMLEntities = require('./xhtml'); | ||
+import * as acorn from "acorn"; | ||
+import XHTMLEntities from './xhtml.js'; | ||
|
||
const hexNumber = /^[\da-fA-F]+$/; | ||
const decimalNumber = /^\d+$/; | ||
@@ -70,7 +71,7 @@ function getQualifiedJSXName(object) { | ||
getQualifiedJSXName(object.property); | ||
} | ||
|
||
-module.exports = function(options) { | ||
+function acornJsx(options) { | ||
options = options || {}; | ||
return function(Parser) { | ||
return plugin({ | ||
@@ -82,16 +83,19 @@ module.exports = function(options) { | ||
|
||
// This is `tokTypes` of the peer dep. | ||
// This can be different instances from the actual `tokTypes` this plugin uses. | ||
-Object.defineProperty(module.exports, "tokTypes", { | ||
+Object.defineProperty(acornJsx, "tokTypes", { | ||
get: function get_tokTypes() { | ||
- return getJsxTokens(require("acorn")).tokTypes; | ||
+ return getJsxTokens(acorn).tokTypes; | ||
}, | ||
configurable: true, | ||
enumerable: true | ||
}); | ||
|
||
+ | ||
+export default acornJsx; | ||
+ | ||
function plugin(options, Parser) { | ||
- const acorn = Parser.acorn || require("acorn"); | ||
+ const acorn = Parser.acorn || acorn; | ||
const acornJsx = getJsxTokens(acorn); | ||
const tt = acorn.tokTypes; | ||
const tok = acornJsx.tokTypes; | ||
diff --git a/node_modules/acorn-jsx/xhtml.js b/node_modules/acorn-jsx/xhtml.js | ||
index c152009..8f5aa79 100644 | ||
--- a/node_modules/acorn-jsx/xhtml.js | ||
+++ b/node_modules/acorn-jsx/xhtml.js | ||
@@ -1,4 +1,4 @@ | ||
-module.exports = { | ||
+export default { | ||
quot: '\u0022', | ||
amp: '&', | ||
apos: '\u0027', |