WebStorm

 1.加快webstorm的运行速度

  (D:\Program Files (x86)\JetBrains\WebStorm 10\bin)下,有一个WebStorm.exe.vmoptions文件,文本编辑工具打开 

  第二行-Xms128m 调到256m 
  第三行-Xms512m 调到800m

2.移除一些不必要的插件

  ASP CoffeeScript 等等

First the official website is helpful 

1.run your node program as dev mode

   run -> Edit Configurations -> Node Parameters 
   add your node-dev path to here, just like "D:\node\node_modules\node-dev\bin\node-dev"

 mac: /usr/local/lib/node_modules/node-dev

   sometimes you need run your apps in harmony mode

   --harmony D:\nodejs\node_modules\node-dev\bin\node-dev

 

2.remove the idea directory in github

  git rm -r one-of-the-directories
  git commit -m "Remove duplicated directory"
  git push origin master

  to remenber this path should not be send.

  settings -> version control -> ignored files :add the file or path you want to ignore

  if your file or project with out the git ,pleace open:

    VCS -> VCS operations popup -> create git repository

  and selete the path of your project than you will find it ok!

 3.WebStorm Watcher Jade In CMD Specification

1.设置WebStorm Watcher
    找到 File-> Settings-> File Watchers
    在右边的面板中点击 + 图标 来增加watcher
    Choose Template -> jade
    填写New Watcher:
    Name:Jade Client Watcher(任意名字即可)
    File type:选择Jade
    Scope:点击...添加watcher的适用范围(这里我们需要把它指定到我们client template的目录下面,以免编译了服务器端的jade template.
    Program:点击...选择我们安装的jade的jade.cmd文件
    Arguments:设置为 --client --no-debug $FilePath$
    Working directory:设置为$FileDir$
   Out paths to refresh:设置为$FileNameWithoutExtension$.html
----我们的webstrom设置完了 2.设置jade编译成CDM格式 找到jade的安装目录 node-> node_modules-> jade-> lib-> jade.js 如果你的jade是安装在项目中的且你使用的是里面的jade.cmd,那么的这里的路径也要对应改过来 找到这个函数 exports.compile = function (str, options) 一般在128行 把 @return 改成{String} 把 if (options.client) return new Function('locals', fn) 注释掉 添加如下代码取代他 //return the function string in CMD specification if (options.client) { var out = [],outputString; out.push('define(function(require,exports,module){\n'); out.push(' module.exports=function(locals){\n'); out.push(' '+fn+' \n'); out.push(' }'); out.push('\n});') outputString=out.join(''); return outputString; } ----End
 4.将underscore.js的template 编译成js 并 利用webstorm 实现自动编译    
    建议将template文件 命名为htm文件 以便做文件识别
   file watcher 设置
  
   scopes 设置
  
  
这个是jst.cmd文件
:: Created by npm, please don't edit manually.
@IF EXIST "%~dp0\node.exe" (
  "%~dp0node.exe" "%~dp0\.\radish\jst\jst.js" %*
) ELSE (
  node "%~dp0\.\radish\jst\jst.js" %*
)

这个 jst.js 依赖 loadsh
 
var _ = require('lodash'),
  fs = require('fs');

var args = process.argv,
  viewName = args.length > 2 ? args[2] : '',
  filePath,
  templateFile,
  outPut;
if (viewName) {
  filePath = process.cwd() + '/' + viewName + '.js';
  templateFile = fs.readFileSync(process.cwd()+'/'+ viewName + '.tpl').toString();
  outPut = 'define(function(){ return '+_.template(templateFile).source +'});';

  fs.writeFileSync(filePath, outPut);
}

  

 

posted @ 2013-10-15 17:04  x.radish  阅读(1260)  评论(0编辑  收藏  举报