-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update JSDOM and create script to automate it
- Loading branch information
Showing
6 changed files
with
1,962 additions
and
2 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
out |
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,12 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const browserify = require('browserify'); | ||
const cp = require('child_process'); | ||
|
||
const jsdompkg = JSON.parse(fs.readFileSync('./node_modules/jsdom/package.json').toString()) | ||
const jsdomloc = path.resolve(path.join('./node_modules/jsdom', jsdompkg.main)); | ||
|
||
const outLoc = `out/jsdom-${jsdompkg.version}.js` | ||
const outMinLoc = `out/jsdom-${jsdompkg.version}.min.js` | ||
cp.execSync(`node_modules/.bin/browserify -s JSDOM ${jsdomloc} > ${outLoc}`); | ||
cp.execSync(`node_modules/.bin/terser ${outLoc} > ${outMinLoc}`); |
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 @@ | ||
{ | ||
"name": "browser-jsdom", | ||
"version": "1.0.0", | ||
"description": "Browserified version of JSDOM", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"generate": "node index.js", | ||
"move": "cp -R out/* ../../packages/app/static/js" | ||
}, | ||
"dependencies": { | ||
"jsdom": "^12" | ||
}, | ||
"devDependencies": { | ||
"browserify": "^16.5.1", | ||
"terser": "^4.8.0" | ||
} | ||
} |
Oops, something went wrong.