前端构建工具

深度JavaScript (Deep JavaScript)

Choosing a development tool based on its popularity isn’t a bad idea. Popular tools are usually more stable, and they often have more resources and community support than less popular tools. Today, I’ll introduce categories of tools and lots of names of specific tools.

根据流行程度选择开发工具不是一个坏主意。 流行的工具通常更稳定,并且与不那么流行的工具相比,它们通常具有更多的资源和社区支持。 今天,我将介绍工具类别和许多特定工具的名称。

Let’s start now…!

让我们现在开始…!

构建工具 (Build Tools)

We build the JavaScript source codes we write to what we deploy using build tools.

我们构建JavaScript源代码,并使用构建工具将这些源代码写入部署的内容。

转运器 (Transpilers)

A transpiler is a tool that compiles source code to source code. There are two transpilers that are popular in the community as follows.

编译器是将源代码编译为源代码的工具。 以下是在社区中流行的两种编译器。

  • Babel is a compiler that helps you write code in the latest version of JavaScript. When your supported environments don’t support certain features natively, Babel will help you compile those features down to a supported version.

    Babel是一个编译器,可以帮助您使用最新版本JavaScript编写代码。 当您支持的环境本身不支持某些功能时,Babel将帮助您将这些功能编译为支持的版本。

  • Typescript is a superset of JavaScript in addition to all the new stuff that the standard is defining, will add a static type system. Typescript has also a transpiler that converts our Typescript code (i.e. ES6 + types) to ES5 or ES3 javascript code so we can use it in today’s browsers.

    Typescript是JavaScript的超集,除了标准定义的所有新内容外,还将添加静态类型系统。 Typescript还有一个编译器,可将我们的Typescript代码(即ES6 +类型)转换为ES5或ES3 javascript代码,因此我们可以在当今的浏览器中使用它。

缩小器 (Minifiers)

A Minifiers is a tool that removes unnecessary or redundant data without affecting how the resource is processed by the browser — e.g. code comments and formatting, removing unused code, using shorter variable and function names, and so on.

Minifiers是一种工具,它可以删除不必要的数据或冗余数据,而不会影响浏览器对资源的处理方式-例如,代码注释和格式设置,删除未使用的代码,使用较短的变量和函数名称等。

There are some popular minifiers including:

有一些流行的缩小器,包括:

  • UglifyJS is a JavaScript parser, minifier, compressor and beautifier toolkit.

    UglifyJS是JavaScript解析器,缩小器,压缩器和美化器工具箱。

  • Babel-minify: use babel-minify if you don't already use babel (as a preset) or want to run it standalone.

    Babel-minify :如果您尚未使用babel(作为预设)或想独立运行,请使用babel-minify。

  • Terser is aJavaScript parser and mangler/compressor toolkit for ES6+.

    Terser是ES6 +JavaScript解析器和mangler / compressor工具包。

  • Closure Compiler is a tool for making JavaScript download and run faster. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what’s left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls.

    Closure Compiler是使JavaScript下载和运行速度更快的工具。 它不是从源语言编译为机器代码,而是从JavaScript编译为更好JavaScript。 它解析您JavaScript,对其进行分析,删除无效代码,然后重写并最大程度地减少剩下的内容。 它还检查语法,变量引用和类型,并警告常见JavaScript陷阱。

捆绑包: (Bundlers:)

A JavaScript bundler is a tool that puts your code and all its dependencies together in one JavaScript file. It also minimizes the size of output by using techniques such as tree-shaking and perform compilation steps such as transpiling and minification while bundling.

JavaScript捆绑程序是一种工具,可将您的代码及其所有依赖项放到一个JavaScript文件中。 它还通过使用诸如摇树之类的技术来最小化输出的大小,并在捆绑时执行诸如编译和最小化之类的编译步骤。

Popular bundlers including:

流行的捆绑器包括:

  • Webpack is a static module bundler for modern JavaScript applications.

    Webpack是用于现代JavaScript应用程序的静态模块捆绑器。

  • Browserify lets you require‘modules’ in the browser by bundling up all of your dependencies.

    Browserify通过捆绑所有依赖项,使您在浏览器中需要'modules'

  • Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex, such as a library or application.

    Rollup是JavaScript的模块捆绑器,可将一小段代码编译为更大或更复杂的内容,例如库或应用程序。

  • Parcel is a web application bundler, differentiated by its developer experience. It offers blazing fast performance utilizing multicore processing, and requires zero configuration.

    Parcel是一个Web应用程序打包程序,其开发人员经验与众不同。 它利用多核处理提供了惊人的快速性能,并且需要零配置。

放在一起 (Put them all together)

We put all of these tools and building steps into so-called task runners such as follows.

我们将所有这些工具和构建步骤放到所谓的任务运行器中,如下所示。

  • Grunt is a task runner to help automate front end development & save time.

    Grunt是一个任务赛跑者,可以帮助自动化前端开发并节省时间。

  • Gulp is a toolkit to automate & enhance your workflow

    Gulp是一个工具包,用于自动化和增强您的工作流程

  • Broccoli is a JavaScript build tool that exposes a simple JavaScript API to perform file-based transformations, allowing developers to easily build complex build pipelines, using a simple, functional API.

    Broccoli是一个JavaScript构建工具,它公开了一个简单JavaScript API来执行基于文件的转换,从而使开发人员可以使用一个简单的功能性API轻松构建复杂的构建管道。

静态检查 (Static checking)

It means that analyzing source code statistically without running it. It can be used to detect a variety of problems including problematic patterns, un-used variables, code styles, and so on.

这意味着无需运行即可统计分析源代码。 它可用于检测各种问题,包括有问题的模式,未使用的变量,代码样式等。

短绒 (Linters)

They are tools that analyze source code to flag programming errors, bugs, stylistic errors, and suspicious constructs.

它们是分析源代码以标记编程错误,错误,风格错误和可疑结构的工具。

  • JSLint is a static code analysis tool used in software development for checking if JavaScript source code complies with coding rules.

    JSLint是用于软件开发的静态代码分析工具,用于检查JavaScript源代码是否符合编码规则。

  • JSHint is a community-driven tool that detects errors and potential problems in JavaScript code.

    JSHint是社区驱动的工具,可检测JavaScript代码中的错误和潜在问题。

  • ESLint — find and fix problems in your JavaScript code.

    ESLint —查找并修复JavaScript代码中的问题。

代码样式检查器 (Code style checkers)

They check if code is formatted properly based on indentation, spaces after brackets, space after commas, etc.

他们根据缩进,方括号后的空格,逗号后的空格等检查代码的格式是否正确。

  • JSCS — JavaScript Code Style Checker. It is a code style linter and formatter for your style guide.

    JSCS — JavaScript代码样式检查器。 它是您的样式指南的代码样式库和格式化程序。

代码格式化程序 (Code formatters)

They automatically format your code according to rules that you can customize.

它们会根据您可以自定义的规则自动设置代码格式。

  • Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.漂亮的是一个自以为是的代码格式化程序。 它通过解析代码并使用自己的规则(考虑最大行长)重新打印代码,从而实现一致的样式,并在必要时包装代码。

类型检查器 (Type checkers)

We use flow as a static type checker for your JavaScript code. It does a lot of work to make you more productive. Making your code faster, smarter, more confidently, and to a bigger scale.

我们将用作您JavaScript代码的静态类型检查器。 它需要做很多工作来提高您的生产力。 使您的代码更快,更智能,更自信,更大规模。

测试框架 (Testing frameworks)

There are many testing frameworks in JavaScript.

JavaScript中有许多测试框架。

单元测试 (Unit testing)

Unit tests only test a single part of your implementation. A unit. No dependencies or integrations, no framework specifics. They’re like a method that returns a link in a specific language. Some popular unit testing frameworks including.

单元测试仅测试实现的一部分。 一个单位。 没有依赖关系或集成,没有框架细节。 它们就像一种以特定语言返回链接的方法。 一些流行的单元测试框架包括。

  • Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests.

    Jasmine是一个行为驱动的开发框架,用于测试JavaScript代码。 它不依赖于任何其他JavaScript框架。 它不需要DOM。 而且它的语法简洁明了,因此您可以轻松编写测试。

  • Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting while mapping uncaught exceptions to the correct test cases.

    Mocha是一个功能丰富JavaScript测试框架,可在Node.js和浏览器中运行,从而使异步测试变得简单而有趣。 Mocha测试是串行运行的,从而可以在将未捕获的异常映射到正确的测试用例的同时,灵活而准确地报告。

  • AVA is a test runner for Node.js with a concise API, detailed error output, embrace of new language features and process isolation that lets you develop with confidence.

    AVA是Node.js的测试运行者,它具有简洁的API,详细的错误输出,新语言功能的拥抱以及进程隔离,使您可以放心地进行开发。

  • Jest is a delightful JavaScript Testing Framework with a focus on simplicity. It works with projects using: Babel, TypeScript, Node, React, Angular, Vue, and more!

    Jest是一个令人愉悦JavaScript测试框架,专注于简单性。 它适用于使用以下项目的项目:Babel,TypeScript,Node,React,Angular,Vue等!

  • The main goal for Karma is to bring a productive testing environment to developers.

    Karma的主要目标是为开发人员带来一个高效的测试环境。

整合测试 (Integration testing)

At some point, your code communicates with a database, file system or another third party. It could even be another module in your app. That piece of implementation should be tested by integration tests. They typically have a more complicated setup that involves preparing testing environments, initializing dependencies, and so on.

在某些时候,您的代码与数据库,文件系统或其他第三方进行通信。 它甚至可能是您应用程序中的另一个模块。 该实现部分应通过集成测试进行测试。 它们通常具有更复杂的设置,其中涉及准备测试环境,初始化依赖关系等。

  • Jenkins is an open source automation server which enables developers around the world to reliably build, test, and deploy their software.

    Jenkins是一个开源自动化服务器,它使世界各地的开发人员能够可靠地构建,测试和部署其软件。

  • Travis CI enables your team to test and ship your apps with confidence.

    Travis CI使您的团队可以放心地测试和发布您的应用程序。

用户界面测试 (User interface testing)

Popular UI testing including.

流行的UI测试包括。

  • CasperJS卡斯珀
  • Protractor量角器
  • Nightwatch.jsNightwatch.js
  • TestCaféTestCafé

包装经理 (Package managers)

A package manager is a piece of software that lets you manage the dependencies that your project needs to work correctly.

程序包管理器是一款软件,可以让您管理项目正常运行所需的依赖项。

The most popular package manager for JavaScript is npm. There are alternatives to npm, but they are all based in one way or another on npm’s software register.

JavaScript最受欢迎的软件包管理器是npm 。 npm有多种选择,但是它们都是基于npm的软件寄存器的一种或多种方式。

  • Yarn is a package manager that doubles down as a project manager. Whether you work on one-shot projects or large monorepos, as a hobbyist or an enterprise user, we’ve got you covered.

    Yarn是一个包管理器,可以兼任项目经理。 无论您是一次性项目还是大型Monorepos,无论是业余爱好者还是企业用户,我们都可以为您服务。

  • Microsoft uses pnpm in Rush repos with hundreds of projects and hundreds of PRs per day, and we’ve found it to be very fast and reliable.

    微软每天在Rush 仓库中使用pnpm进行数百个项目和数百个PR,我们发现它非常快速和可靠。

It is all about tools in JavaScript. Try to choose the best tools for yourself.

这全都与JavaScript中的工具有关。 尝试为自己选择最好的工具。

Thanks for reading! Did we miss any tools that you think should be included? If so, leave a comment with your recommendations!

谢谢阅读! 我们是否错过了您认为应包含的任何工具? 如果是这样,请留下您的建议评论!

翻译自: https://medium.com/javascript-in-plain-english/the-most-popular-javascript-tools-you-should-be-using-7630a424186a

前端构建工具


http://www.taodudu.cc/news/show-6261425.html

相关文章:

  • nodejs:三个点(...)是什么
  • nodejs和java对比_nodejs与java的区别是什么?
  • Nodejs和ajax不同,Nodejs和AJAX的区别是什么?
  • nodejs和js之间有什么区别?
  • nodejs简单介绍
  • java与nodejs区别_nodejs和java之间有什么区别?
  • nodejs到底是什么?
  • nodejs 判断是文件夹还是文件
  • vue为什么需要nodejs 的环境
  • catalan 数。。
  • Catalan number卡特兰数
  • 【算法】Catalan数
  • Catalan卡特兰数
  • Catalan 数的应用
  • 卡特兰数Catalan
  • Catalan number (卡兰特数)
  • Catalan数的分析和应用
  • 关于Catalan(卡特兰)数的理解
  • 卡特兰数 Catalan number
  • 卡特兰数——Catalan数
  • Catalan数(卡特兰数)系列问题及代码
  • 卡特兰数Catalan number的应用
  • Catalan (卡特兰数)
  • [杂谈] 14. Catalan卡特兰数
  • 三种恒流源
  • 压控恒流源电路设计
  • 恒流源方案
  • 恒流源的制作
  • 小功率恒流源芯片推荐
  • 6种最常用恒流源电路的分析与比较

前端构建工具_构建工具相关推荐

  1. 代码同步工具_构建现代化的命令行工具

    每当我们想要创建一个基于 NodeJS 的命令行工具时,就会衍生出一堆问题需要解决,比如如何准备开发环境,如何打包转译代码,如何使代码在转译后保持可调用的状态同时尽可能的压缩体积, 以及怎样设计项目分 ...

  2. 属性匹配工具_测试工具链——高效构建Mock服务

    现在,WEB系统的开发一般都采用前后端分离的架构,以及部分公司采用"前台-中台-后台"的组织架构,难免会出现开发进度不一致的情况,导致系统联调或测试需要等到所有依赖开发完成后才能够 ...

  3. 系统封装工具_去工具化/脚本化理解,自动化运维落地最佳实践之业务/架构/模型/方法...

    本文转载自:互联网运维杂谈 近年来后端IT也呈现更复杂的形态,底层IT架构逐渐开放平台化.云化,上层应用微服务化等等,虚拟化.云平台.容器PaaS和云原生框架都进入到IT运行环境中,而传统业务依然运行 ...

  4. arcgis工具_地理工具学习--arcgis篇(16):标准距离

    很久没写gis工具的分享了,今天分享一个空间统计工具箱里的工具.这个工具可以做一些比较简单空间模式分析. 比如某些要素主要分布在哪些区域等等. 这个工具位置在: 中文版的位置:空间统计工具箱--度量地 ...

  5. cad2008加载 et拓展工具_生物信息工具 | 如何为网络图添加漂亮的图例?

    |撰文:莫北 在之前一文中<如何用Gephi绘制漂亮的网络图>一文中,为大家介绍过如何绘制下图这样好看的网络图. 基迪奥生物:生物信息工具 | 如何用Gephi绘制漂亮的网络图?​zhua ...

  6. 并发测试工具_性能测试工具基本工作原理及基本操作流程

    性能测试的基本概念 性能测试:是指在特定情况下测试系统如何执行的.资源的使用.可扩展性和可靠性也是性能测试的范畴.性能测试是性能工程的一个子集,主要发现软件架构以及设计导致的性能问题. 性能测试的目标 ...

  7. android系统构建系统_构建系统简介

    android系统构建系统 Jan. 21. 2016 2016年1月21日 Roughly speadking, build in software development is the proce ...

  8. 华为开源构建工具_构建开源软件长达5年并以故事为生

    华为开源构建工具 I've been working on open-source software for 5 years now and I'm still going. It's not som ...

  9. jenkins构建记录日志_构建企业日志记录层的清单

    jenkins构建记录日志 在有关云迁移服务,数据中心和微服务等大型主题的任何讨论中,企业日志记录主题都可以归结为事后想法. 但是这样做的后果自负,因为如果不进行日志记录,就无法对服务进行有效的诊断和 ...

最新文章

  1. 通俗易懂word2vec详解词嵌入-深度学习
  2. 第一次使用cookie
  3. 安装python后如何打开-Python的安装与使用
  4. Saber2016安装包和安装详细安装步骤
  5. 利用反射,实现动态调用winform窗体
  6. 冒泡法排序c语言函数模板,使用模板技术的冒泡排序
  7. 对std::listT的封装
  8. 【转】Jenkins+Ant+Jmeter接口自动化集成测试实例
  9. OpenAI对强化学习环境的汇总
  10. 自动驾驶商用车需要什么样的电气架构?
  11. 5款伊思儷超媒體繁体游戏 简体中文补丁
  12. MySQL常规篇之增删改查(精选)
  13. 微信公众号开发,移动端开发遇到的问题及其他技巧
  14. IIS URL 重写
  15. 解决网课作业无法粘贴问题
  16. 数字图像处理及其表示
  17. 当APO生产订单报工遇到物料账期没开
  18. javaMap集合 详解
  19. PYTHON TRACEBACK
  20. Unity 文字显示动画

热门文章

  1. 一本通-1414:成绩
  2. MIDI音乐制作概论,常用插件与流行音乐模板
  3. linux系统的midi制作软件,在ubuntu系统下制作midi音乐
  4. windows11打开隐藏的gpedit.msc本地组策略编辑器以及禁止自动更新系统
  5. iis日志分析 seo必备技能
  6. linux开机启动任务和定时执行任务
  7. hbase集群的搭建(完全分布式)
  8. 什么是MVC设计模式???
  9. CityMaker学习教程03 数据的导入
  10. 51单片机入门教程(3)——数码管显示学号