Javascript project with multiple files

你说的曾经没有我的故事 提交于 2019-12-24 02:08:04

问题


What is the best IDE/editor/anything-else that manage javascript project on multiple files? I mean, is there a way of developing projects on multiple files and then kinda "build" the project into a single minified file? I've seen that this is done in lots of projects on the net. Thanks!


回答1:


I don't think there is any all-in-one solution for that (yet). You need to combine several tools:

  • IDE: WebStorm, Aptana, or even Notepad++
  • Cross-Compiler: Sass, CoffeeScript etc.
  • Compressor: Google Closure Compiler, UglifyJS or YUICompressor
  • Build tool triggering a build process, managing folder structures etc.
    Personally, I use loads of Bash scripts, but I've seen people use Maven or Ant
  • There are also Frameworks with integrated build tools, supporting dev/production mode, something like qooxdoo, Sencha, ...

If you're on a small to medium-sized project, running the tools manually might be the best solution in terms of cost-benefit ratio, since automation requires quite a bit of work.




回答2:


There are a lot of ways to do that. In my case we using nodejs and requirejs with uglify lib. you can read it here

It gives me an ability to deploy minified files with one bash script.




回答3:


The best editor for multiple files project is WebStorm from JetBrains !!! You can use online resources for merging the files. http://jscompress.com/ is a good tool for that.




回答4:


You can do this really easily in Visual Studio 2012 using Web Essentials


Bundles can easily be edited and they output combined and combined minified files every time you save one of the bundled files.



来源:https://stackoverflow.com/questions/10009171/javascript-project-with-multiple-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!