小编kam*_*psj的帖子

AngularCli:禁用缩小

有没有办法禁用AngularCli中的缩小?

在我启动命令之后,ng build --prod我需要将所有files.js放在dist文件夹中,分开且清晰.

angular-cli

27
推荐指数
5
解决办法
2万
查看次数

如何使用生产构建设置和AOT启用角度克隆测试

有没有办法使用命令ng test告诉下划线编译器使用ng build --prod设置来运行角度cli测试?

我问,因为与这里遇到的往往AOT编译错误ng build --prod不正常编译发生ng build

angular-cli angular2-aot

9
推荐指数
1
解决办法
1031
查看次数

将PowerShell中的日期时间格式化为JSON格式为\/Date(1411704000000)\ /

我希望以下列格式将当前日期作为字符串获取:

\/Date(1411762618805)\/

我一直在与PowerShell斗争,并尝试了以下内容,但它不断地用不需要的属性包装对象.我只需要value

Get-Date | ConvertTo-Json
# returns
{
  "value":  "\/Date(1411762618805)\/",
  "DisplayHint":  2,
  "DateTime":  "Friday, September 26, 2014 4:16:58 PM"
}
Run Code Online (Sandbox Code Playgroud)

当然,如果您尝试转换回对象,ConvertFrom-Json则返回.NET Date对象.

我已经接近了

Get-Date | Select-Object -Property Date | ConvertTo-Json
{
  "Date":  "\/Date(1411704000000)\/"
}
Run Code Online (Sandbox Code Playgroud)

但它仍然包含在Date子属性中.在一天结束时,我想要的只是一个带有微软丑陋JSON格式的字符串.

我只想尽可能使用内置的.NET JSON序列化程序.

.net powershell datetime

7
推荐指数
2
解决办法
6379
查看次数

如何仅在maven-jarsigner-plugin中发布时配置TSA参数

在我们的jar中添加一个时间戳会导致我们的maven构建比平常花费大约4倍.时间戳是发布版本所必需的,但我们不需要它来进行快照构建.我们如何将POM文件配置为仅在发布版本时添加TSA参数(即SNAPSHOT未出现在项目版本中).

下面是jarsigner插件的POM条目.请注意底部添加的参数.如果SNAPSHOT出现在项目版本中,我们希望不添加这些:

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jarsigner-plugin</artifactId>
          <version>1.2</version>
          <executions>
            <execution>
              <id>sign webcontent jars</id>
              <phase>prepare-package</phase>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <archiveDirectory>${project.build.directory}/projectname-webcontent/applets</archiveDirectory>
            <includes>
              <include>*.jar</include>
            </includes>
            <keystore>Keystore</keystore>
            <alias>alias</alias>
            <storepass>pass</storepass>
            <arguments>
              <argument>-tsa</argument>
              <argument>https://timestamp.geotrust.com/tsa</argument>
            </arguments>
          </configuration>
        </plugin>
Run Code Online (Sandbox Code Playgroud)

java jarsigner pom.xml maven

6
推荐指数
1
解决办法
2204
查看次数

如何在angular cli中使用模块名称别名?

使用独立webpack,您可以使用别名进行模块解析.你的webpack.config文件中的这样的东西,config.resolve块:

config.resolve = {
    extensions: ['', '.ts', '.js', '.json', '.css', '.scss', '.html'],
    alias: {
      'app': 'src/app',
      'common': 'src/common',
       'a_module_name': 'file_path_to_module_name'
    }
  };
Run Code Online (Sandbox Code Playgroud)

你如何在angular cli中使用webpack,如别名解析?

webpack angular-cli

5
推荐指数
1
解决办法
602
查看次数

HTTP Response Content-Length标头中的逗号来自哪里?

我正在使用Fiddler监视对ServiceStack API的调用,我在Content-Length字段中看到一个逗号.当我部署到特定的Windows服务器时,我才会看到这一点.那是什么意思?

Content-Length: 611,0
Run Code Online (Sandbox Code Playgroud)

整个回复:

HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 611,0
Content-Type: text/plain
ETag: 635102562728230000
Server: Microsoft-IIS/8.0
X-Powered-By: ServiceStack/3.955 Win32NT/.NET
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 24 Jul 2013 19:03:34 GMT

raw data removed but it is 611 characters
Run Code Online (Sandbox Code Playgroud)

我不认为Content-Length字段中的逗号是允许的.

http servicestack

3
推荐指数
1
解决办法
816
查看次数