ember.js 如何在ember应用程序中更改临时目录位置

iq3niunx  于 2022-11-05  发布在  其他
关注(0)|答案(3)|浏览(134)

是否有办法更改ember-cli用来处理树的tmp目录的位置?(不使用符号链接)
我正在尝试在Windows主机上使用linux VM开发一个ember应用程序。任何类型的共享文件夹(无论是virtualbox共享文件夹、nfs还是smb)都很慢,不允许使用符号链接,并且ember-cli会在tmp目录中生成很多文件。如果能够将此tmp移动到VM的本机文件系统中,将有很大帮助。
这应该很容易配置,但我找不到任何配置选项,将允许它。

ar7v8xwq

ar7v8xwq1#

没有。没有人回答,ember-cli构建的帮助也没有显示该参数。

hzbexzde

hzbexzde2#

How about creating a RAMDisk and hardlinking your project tmp folder to it? In Windows this can be done as follows:

  • Create RAM DISK with imdisk
  • mklink /j "C:\project\tmp\" "H:\ember-tmp" where C:\project is your local project folder and H: is your RAM Disk.

I'm afraid I don't know the Linux equivalents but it should be easy enough to find. Apparently this can roughly halve your build times with no chance of losing data.
Information sourced from https://emberjs-developer.quora.com/How-to-make-Ember-js-CLI-ember-s-32-times-faster and kudos to Stefan Penner for the suggestion.
Note the link folder MUST already exist before you run mklink otherwise you get the misleading message "Local volumes are required to complete the operation" and the link destination (junction folder) MUST NOT exist otherwise you get the message "Cannot create a file when that file already exists".

z8dt9xmd

z8dt9xmd3#

请注意,从Ember 3.0开始,您现在可以通过执行以下操作来更改该高速缓存

BROCCOLI_PERSISTENT_FILTER_CACHE_ROOT=/path/to/my/other/tmp/

这会将broccolli文件输出到您选择的路径。您需要自己在这个自定义路径上进行整理操作
更多信息https://github.com/stefanpenner/async-disk-cache/issues/35

相关问题