-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Otherwise, using browser-monkey with webpack requires hyperdom and react to be installed.
- Loading branch information
Showing
8 changed files
with
29 additions
and
11 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 |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
/dist/ | ||
docs-dist/ | ||
.exrc | ||
*Mount.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env node | ||
const fs = require('fs') | ||
|
||
function moveFileAndUpdateImports(path) { | ||
fs.copyFileSync(`./dist/lib/${path}`, `./${path}`) | ||
fs.copyFileSync(`./dist/lib/${path}.map`, `./${path}.map`) | ||
|
||
const jsFile = fs.readFileSync(`./${path}`, {encoding: 'utf-8'}) | ||
const newJsFile = jsFile.replace(/require\("\.\//, 'require("./dist/lib/') | ||
fs.writeFileSync(`./${path}`, newJsFile) | ||
|
||
const mapFile = fs.readFileSync(`./${path}.map`, {encoding: 'utf-8'}) | ||
const newMapFile = mapFile.replace('../..', '.') | ||
fs.writeFileSync(`./${path}.map`, newMapFile) | ||
} | ||
|
||
moveFileAndUpdateImports('HyperdomMount.js') | ||
moveFileAndUpdateImports('ReactMount.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,15 +1,11 @@ | ||
import {Query} from './lib/Query' | ||
import IFrameMount from './lib/IFrameMount' | ||
import Mount from './lib/Mount' | ||
import ReactMount from './lib/ReactMount' | ||
import HyperdomMount from './lib/HyperdomMount' | ||
import * as matchers from './lib/matchers' | ||
|
||
export { | ||
Query, | ||
IFrameMount, | ||
Mount, | ||
ReactMount, | ||
HyperdomMount, | ||
matchers, | ||
} |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import Mount from './Mount' | ||
import ReactDOM from 'react-dom' | ||
|
||
export default class ReactMount extends Mount { | ||
public constructor (vdom: any) { | ||
super() | ||
const div = this.containerElement() | ||
|
||
const ReactDOM = require('react-dom') | ||
ReactDOM.render(vdom, div) | ||
} | ||
} |
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