-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v1.7.8] Merge pull request #275 from bridge-core/dev
- Loading branch information
Showing
301 changed files
with
8,361 additions
and
20,801 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 |
---|---|---|
|
@@ -10,3 +10,5 @@ npm-debug.log | |
npm-debug.log.* | ||
thumbs.db | ||
!.gitkeep | ||
|
||
.env |
This file was deleted.
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 |
---|---|---|
@@ -1,22 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>bridge.</title> | ||
<% if (htmlWebpackPlugin.options.nodeModules) { %> | ||
<!-- Add `node_modules/` to global paths so `require` works properly in development --> | ||
<script> | ||
require("module").globalPaths.push("<%= htmlWebpackPlugin.options.nodeModules.replace(/\\/g, '\\\\') %>") | ||
</script> | ||
<% } %> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<!-- Set `__static` path to static files in production --> | ||
<script> | ||
if(process.env.NODE_ENV !== "development") window.__static = require("path").join(__dirname, "/static").replace(/\\/g, "\\\\") | ||
</script> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>bridge.</title> | ||
<% if (htmlWebpackPlugin.options.nodeModules) { %> | ||
<!-- Add `node_modules/` to global paths so `require` works properly in development --> | ||
<script> | ||
require('module').globalPaths.push( | ||
"<%= htmlWebpackPlugin.options.nodeModules.replace(/\\/g, '\\\\') %>" | ||
) | ||
</script> | ||
<% } %> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<!-- Set `__static` path to static files in production --> | ||
<script> | ||
if (process.env.NODE_ENV !== 'development') | ||
window.__static = require('path') | ||
.join(__dirname, '/static') | ||
.replace(/\\/g, '\\\\') | ||
</script> | ||
|
||
<!-- webpack builds are automatically injected --> | ||
</body> | ||
<!-- webpack builds are automatically injected --> | ||
</body> | ||
</html> |
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,33 @@ | ||
import { promises as fs } from 'fs' | ||
import { join } from 'path' | ||
import { BRIDGE_DATA_PATH, DEPS_URLS } from '../constants' | ||
import Store from '../../store/index' | ||
|
||
export async function loadDependency(src: string) { | ||
//In development mode, always use data from disk | ||
if (process.env.NODE_ENV === 'development' && process.env.DEV_DATA_PATH) | ||
return eval( | ||
await ( | ||
await fs.readFile(join(process.env.DEV_DATA_PATH, src)) | ||
).toString('utf-8') | ||
) | ||
|
||
const script = await fetch( | ||
join(DEPS_URLS(Store.state.Settings.remote_data_version), src) | ||
) | ||
.then(data => data.text()) | ||
.then(async script => { | ||
try { | ||
fs.mkdir(join(BRIDGE_DATA_PATH, 'cache'), { recursive: true }) | ||
} catch {} | ||
fs.writeFile(join(BRIDGE_DATA_PATH, 'cache', src), script) | ||
return script | ||
}) | ||
.catch(async () => { | ||
return await ( | ||
await fs.readFile(join(BRIDGE_DATA_PATH, 'cache', src)) | ||
).toString('utf-8') | ||
}) | ||
|
||
return eval(script) | ||
} |
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
Oops, something went wrong.