FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ClearScript/ClearScript/V8/V8ScriptEngine.InitScript.tt at master · SoniSoft-IO/ClearScript · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
SoniSoft-IO
/
ClearScript
Public
forked from
ClearFoundry/ClearScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ClearScript
/
ClearScript
/
V8
/
V8ScriptEngine.InitScript.tt
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (29 loc) · 1.27 KB
Breadcrumbs
ClearScript
/
ClearScript
/
V8
/
V8ScriptEngine.InitScript.tt
Copy path
File metadata and controls
34 lines (29 loc) · 1.27 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ output extension=".cs" #>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="System.Net.Http" #>
<#@ import namespace="EnvDTE" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Net.Http" #>
<#
var dte = (DTE)((IServiceProvider)Host).GetService(typeof(DTE));
var solutionPath = Path.GetDirectoryName(dte.Solution.FullName);
var scriptPath = Path.Combine(solutionPath, "ClearScript", "V8", "V8ScriptEngine.InitScript.js");
var script = File.ReadAllText(scriptPath);
var contentData = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("input", script) };
using var client = new HttpClient();
using var content = new FormUrlEncodedContent(contentData);
using var response = client.PostAsync("https://www.toptal.com/developers/javascript-minifier/api/raw", content).Result;
response.EnsureSuccessStatusCode();
script = response.Content.ReadAsStringAsync().Result.Replace('\"', '\'');
#>
namespace Microsoft.ClearScript.V8
{
public sealed partial class V8ScriptEngine
{
private const string initScript = "<#= script #>";
}
}
Back
|
FazBrowse Home
|
New Git URL