Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
now uses web-module-linker, please re-run npm install to solve depend…
…encies
- Loading branch information
Showing
6 changed files
with
17 additions
and
34 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/.idea | ||
/node_modules | ||
/src/** | ||
!/src/cm-chessboard | ||
!/src/cm-chessboard/** | ||
/lib |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,27 +1,5 @@ | ||
const fs = require("fs") | ||
const process = require("process") | ||
const path = require("path") | ||
const WebModuleLinker = require("web-module-linker") | ||
|
||
// link dependencies | ||
process.chdir('./src') | ||
symlinkModuleSrc("svjs-svg") | ||
const linker = new WebModuleLinker(__dirname) | ||
|
||
|
||
function symlinkModuleSrc(moduleName) { | ||
try { | ||
fs.symlinkSync(resolveModulePath(moduleName), moduleName, "dir") | ||
} catch (e) { | ||
console.log(e.message) | ||
} | ||
} | ||
|
||
function resolveModulePath(moduleName) { | ||
try { | ||
const pathToMainJs = require.resolve(moduleName) | ||
console.log("pathToMainJs", pathToMainJs) | ||
return pathToMainJs.substr(0, pathToMainJs.lastIndexOf(moduleName) + moduleName.length) | ||
} catch (e) { | ||
console.warn(e) | ||
return null | ||
} | ||
} | ||
linker.symlinkModuleSrc("svjs-svg") |
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