ic卡写卡 angus

Nick's outstanding utility, Angus, has changed! Click here to read an updated post!

尼克杰出的实用工具安格斯(Angus)已经改变了! 点击这里阅读更新的帖子!

When it comes to building web apps, there are a couple of tools available that help you develop faster. There's GruntJS, GulpJS, Brunch and others which streamline your workflow by doing a series of build tasks:

在构建Web应用程序时,有一些可用的工具可帮助您更快地开发。 有GruntJS , GulpJS , Brunch等,它们通过执行一系列构建任务来简化工作流程:

  • Test the code测试代码
  • Clean the build directory清理构建目录
  • Copy source files to the build folder将源文件复制到构建文件夹
  • Do some magic tricks on your copied files, such as replacing variable names.对复制的文件做一些魔术,例如替换变量名。
  • Compile Less or Sass files编译更少或Sass文件
  • Dynamically generate script tags for your index.html为您的index.html动态生成脚本标签
  • Run a webserver to test out your app locally运行网络服务器以在本地测试您的应用
  • Watch for code changes and re-build观察代码更改并重新构建
  • ......

These tools do an outstanding job of helping you develop your web app faster. Huzzah!

这些工具在帮助您更快地开发Web应用程序方面做得非常出色。 晕!

让我们构建另一个应用程序! (Let's Build Another App!)

Once you have finished your app and have started on a new project, you again would like to have a good build configuration. You have optimised your last app's build config so it builds as efficiently as possible, and it's got some cool gimmicks like that AWS S3 deploy task which you spent a couple of hours on last weekend.

完成应用程序并开始新项目后,您再次希望拥有良好的构建配置。 您已经优化了上一个应用程序的构建配置,以使其尽可能高效地构建,并且有一些很酷的头,例如上个周末您花了几个小时的AWS S3部署任务。

Obviously, you want to reap the fruits of your hard labor and use those new and optimised build tasks in your new app as well. What to do now? There are a couple of ways.

显然,您希望收获辛勤工作的成果,并在新应用程序中使用那些经过优化的新构建任务。 现在要做什么? 有两种方法。

复制旧应用 (Duplicating the Old App)

You could just copy paste your old app folder, rename it and start working. The problem comes when you are improving your build setup even further. By now, there are likely newer and faster build tasks available, so you eagerly start implementing those in your new app. And wow, now there's a soft CSS refresh feature in the new app!

您可以复制粘贴旧的应用程序文件夹,将其重命名并开始工作。 当您进一步改善构建设置时,就会出现问题。 到目前为止,可能会有更新,更快的构建任务可用,因此您急切地开始在新应用程序中实现这些任务。 哇,新应用程序现在提供了软CSS刷新功能!

A few days later you need to bring an update to your old app. You painfully notice some cool features are missing in the old app's build config. Like that soft CSS refresh and the numerous performance updates you've made. What now?

几天后,您需要对旧应用进行更新。 您痛苦地注意到旧应用程序的构建配置中缺少一些很酷的功能。 像软CSS刷新和您所做的众多性能更新一样。 现在怎么办?

约曼 (Yeoman)

One solution to the problem is Yeoman, a scaffolding tool. It generates your build config by asking questions, every time you make a new app. On its website you can find plenty of generators which include web frameworks and build tasks that have been set-up for you. These generators are maintained by many people and you will reap the benefits of their optimisations when you generate a new app.

解决这个问题的一种方法是脚手架工具Yeoman 。 每当您制作新应用时,它都会通过提问来生成您的构建配置。 在其网站上,您可以找到大量的生成器,包括Web框架和为您设置的构建任务。 这些生成器由许多人维护,生成新应用时,您将获得其优化的好处。

Generators aren't perfect however. When they are updated to include new tools and optimisations, you are stuck with your old build config. You can't simply update without generating and answering those scaffolding questions again. In addition, it is likely that your ideal build config requires changing or adding tasks such as the AWS S3 deploy which you need for your particular client.

发电机并不是完美的。 当它们进行更新以包括新工具和优化时,您将无法使用旧的构建配置。 您不能简单地更新,而不必再次生成并回答这些脚手架问题。 此外,理想的构建配置可能需要更改或添加特定客户端所需的任务,例如AWS S3部署。

The problem is that at the end of the day, you are again duplicating logic. When you have several apps, it is very likely that the build steps are similar if not identical. If you want to change something there or add a cool new build feature to many apps, you're out of luck.

问题是,归根结底,您还是在重复逻辑。 当您有多个应用程序时,构建步骤很可能是相似的(如果不一致)。 如果您想在那里更改某些内容或为许多应用程序添加酷炫的新构建功能,那么您就不走运了。

不要重复自己 (Don't Repeat Yourself)

A build config is just like any other code. You should not repeat yourself and you want to re-use your build config across different apps. What if there was a way to use one build configuration for all your apps?

构建配置与其他任何代码一样。 您不应该重复自己的操作,而要在不同的应用程序之间重用构建配置。 如果有一种方法可以对所有应用程序使用一个构建配置怎么办?

介绍安格斯 (Introducing Angus)

Amid growing frustration with the state of things, I decided to make a generic and pre-configured build framework called Angus.

在对事物状态越来越沮丧的情况下,我决定制作一个称为Angus的通用且预先配置的构建框架。

Angus is a pre-configured build framework that you simply clone as a git repository. Inside this repo, you build your apps inside an apps/ folder which gets ignored by the Angus repo. For each app, you can define which libraries and build steps you would like to use. Every build task is already configured to work with other tasks.

Angus是一个预先配置的构建框架,您只需将其克隆为git存储库即可。 在此存储库中,您可以在apps/文件夹中构建应用程序,而该文件将被Angus存储库忽略。 对于每个应用程序,您可以定义要使用的库和构建步骤。 每个构建任务都已配置为与其他任务一起使用。

The framework uses GruntJS to do all build steps. The cool thing is that you don't need to configure anything, you just need to tell which tasks you'd like to enable per app.

该框架使用GruntJS完成所有构建步骤。 很棒的事情是您不需要配置任何东西,只需要告诉您要为每个应用程序启用哪些任务即可。

项目结构 (Project Structure)

angus/   <-- angus repository
Gruntfile.js
grunt/   <-- generic build tasks
apps/
hello-world/
my-second-app/    <-- app sub repository
assets/
scss/
app.js
config.js
index.html

内置应用! (Apps Inside!)

Unknown to many, Git repositories can actually exist within each other without using rocket science like submodules. Inside Angus, the apps/ folder gets ignored by git. You can safely create sub-folders inside apps/ which have their own repositories! To do so, simply create a folder inside the apps/ folder and run git init.

许多人都不知道,Git存储库实际上可以彼此存在,而无需像子模块那样使用火箭科学。 在Angus内部,git会忽略apps/文件夹。 您可以在有自己存储库的 apps/安全地创建子文件夹! 为此,只需在apps/文件夹内创建一个文件夹,然后运行git init

Given this structure, you can develop as many apps as you like without having to generate or adjust build configurations.

有了这种结构,您可以开发任意数量的应用程序,而不必生成或调整构建配置。

配置每个应用 (Configuring Each App)

Every app inside Angus has its own configuration file, config.js. In this file, you can define Bower libraries and tell Angus which files from Bower you actually need. When including Bootstrap for instance, you may only really need a couple of .scss files.

安格斯内部的每个应用程序都有其自己的配置文件config.js 。 在此文件中,您可以定义Bower库,并告诉Angus您实际需要Bower中的哪些文件。 例如,当包含Bootstrap时,您可能实际上只需要几个.scss文件。


**Example config file**
packages: [
'angular',
'bootstrap-sass-official'
],
// A list of files which this app will actually use from the bower packages above.
// Angus will look inside bower_components/ for these files.
libIncludes: {
js: [
'angular/angular.js'
],
scss: [
// Core variables and mixins
'bootstrap-sass-official/assets/stylesheets/bootstrap/_variables.scss',
'bootstrap-sass-official/assets/stylesheets/bootstrap/_mixins.scss',
'bootstrap-sass-official/assets/stylesheets/bootstrap/_grid.scss'
]
}

运行应用 (Running the App)

Simply run grunt dev, and Angus takes care of the rest. By default it will launch the hello-world application, but you can pass the —app=your-app parameter or change the config.json file in the root Angus folder.

只需运行grunt dev ,剩下的事情由安格斯负责。 默认情况下,它将启动hello-world应用程序,但是您可以传递—app=your-app参数或更改Angus根文件夹中的config.json文件。

Angus will automatically install Bower packages, auto include libraries and serve your app. It comes with [pushState support](http://diveintohtml5.info/history.html), auto-refresh on code changes and soft CSS refresh on CSS changes.

Angus将自动安装Bower软件包,自动包含库并为您的应用程序提供服务。 它带有[pushState support](http://diveintohtml5.info/history.html),对代码更改的自动刷新和对CSS更改的软CSS刷新。

部署中 (Deploying)

Angus also includes a grunt prod command, which takes care of minification, uglifying and concatenating. The output of your files will be inside the dist/prod/ folder. You can even deploy directly to Amazon S3 with one command.

安格斯(Angus)还包括一个grunt prod unt的grunt prod命令,该命令负责缩小,丑化和连接。 文件的输出将在dist/prod/文件夹中。 您甚至可以使用一个命令直接部署到Amazon S3

其他任务 (Additional Tasks)

You can easily enable additional tasks you would like your app to execute. If you're running AngularJS, chances are you'll be wanting to use common build tasks specific to AngularJS such as template minifying, constants generation and the ng-min library.

您可以轻松启用希望您的应用执行的其他任务。 如果您正在运行AngularJS,则可能会想要使用特定于AngularJS的常见构建任务,例如模板缩小,常量生成和ng-min库。

The cool thing is, these tasks are already preconfigured! You just need to enable them as follows in your config.js file:

最酷的是,这些任务已经预先配置! 您只需要在config.js文件中启用它们,如下所示:

// In addition to the default task list (core/defaultTasks.js), also execute these
gruntTasksAdd: [
'html2js',
'ngconstant',
'ngmin',
'karma'
],

未来 (The Future)

Angus is still a very fresh project, and I encourage you to help out by checking out the source code and sending pull requests. In the future, we may even switch to newer tools such as GulpJS or Brunch, but with the same philosophy. Don't repeat yourself!

Angus仍然是一个非常新鲜的项目,我鼓励您通过签出源代码并发送请求请求来提供帮助。 将来,我们甚至可能会切换到更新的工具,例如GulpJS或Brunch,但使用相同的理念。 不要重复自己!

I hope I have given you fresh insights into the build process of web apps, and how Angus can increase your productivity. Give it a try and let me know what you think!

希望我能为您提供有关Web应用程序构建过程的新见解,以及安格斯如何提高您的生产力。 试试看,让我知道您的想法!

翻译自: https://davidwalsh.name/building-web-apps-faster-angus

ic卡写卡 angus


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

相关文章:

  • 玩转Atlas200DK(十四)玩转摄像头
  • 金格控件java版本_金格全文批注中间件软件下载
  • 1:MOST: A Multi-Oriented Scene Text Detector with Localization Refinement
  • 关于python打包exe文件的教程(专治痛点)
  • 安卓课本练习4-4和4-5
  • handwrite-2
  • handwrite-1
  • MediaCodec硬编码成H264视频流
  • java代码在页面实现展示pdf文件
  • 绘制PDF曲线
  • 算法笔记——【分治法】线性时间选择
  • 线性时间选择 python实现 计算机算法设计与分析
  • Top k问题(线性时间选择算法)
  • 最坏情况为线性时间的选择算法(SELECT)
  • 【语音识别】基于DTW算法实现0~9数字和汉字语音识别含Matlab源码
  • DTW 算法的实时语音识别——命令词识别(Python 实现)
  • 导线型号与其载荷电流对照表
  • AWG、SWG、BWG线径规格对照表
  • 导线截面积和电流的关系
  • 图像去雾(二)Retinex图像增强算法
  • 图像增强去雾之直方图均衡化/同态滤波/Retinex算法
  • 【CAD插件】YQ插件辅助
  • Android动态图标包制作教程,IT之家教程:使用安卓图标包美化Windows 10
  • NekoHtml解析 html 文件
  • nekohtml中解析中出现中文乱码问题
  • NekoHTML和JTIDY解析器简介
  • python对字符串按照ascII码顺序排序
  • 上、下、左、右键的ASCII值
  • 学生优化(一)------输入文本限制
  • Key Scan Codes - 键盘按键 扫描码 表 - KeyCode 码 KeyAscII 码 - HackerJLY

ic卡写卡 angus_使用Angus更快地构建Web应用程序相关推荐

  1. 使用BaaS更快地构建Xamarin应用程序

    目录 问题 什么是MVP? 解决方案 创建RESTful后端 抓取您的帐户名称 抓取您的API密钥 创建一个新项目 获取Android模拟器设置 添加MeshyDB SDK 建立连接 配置客户端 注册 ...

  2. [STM32] Stm32f103c8t6+RC522 实现读卡写卡功能(超详细,零基础,小白)

    本篇文章内容总结下来就是 读卡            使用默认密码读卡所有扇区所有块的数据 写ID            使用默认密码读取卡一的0扇区的第一块数据并写入到卡二的0扇区的第一块里 密码读 ...

  3. 如何写出让 CPU 跑得更快的代码?

    作者 | 小林coding 来源 | 小林coding(ID:CodingLin) 前言 代码都是由 CPU 跑起来的,我们代码写的好与坏就决定了 CPU 的执行效率,特别是在编写计算密集型的程序,更 ...

  4. 面试官:如何写出让 CPU 跑得更快的代码?

    前言 代码都是由 CPU 跑起来的,我们代码写的好与坏就决定了 CPU 的执行效率,特别是在编写计算密集型的程序,更要注重 CPU 的执行效率,否则将会大大影响系统性能. CPU 内部嵌入了 CPU ...

  5. 如何写出让 CPU 跑得更快的代码

    前言 代码都是由 CPU 跑起来的,我们代码写的好与坏就决定了 CPU 的执行效率,特别是在编写计算密集型的程序,更要注重 CPU 的执行效率,否则将会大大影响系统性能. CPU 内部嵌入了 CPU ...

  6. 如何写出让CPU跑得更快的代码?

    如何写出让CPU跑得更快的代码? 一.CPU缓存有多快? 二.CPU缓存的数据结构和读取过程是什么样的? 三.如何提升数据缓存的命中率? 论如何写出让CPU跑得更快的代码,由于我们的CPU的主频已经是 ...

  7. .NET Core 2.1 Preview 1发布:更快的构建性能

    今天,我们宣布发布 .NET Core 2.1 Preview 1.这是 .NET Core 2.1 的第一个公开发布.我们有很大的改进希望分享出来,并且渴望得到您的反馈意见,无论是在评论中还是在gi ...

  8. 服务器webpack构建性能,[译] 优化 WEBPACK 以更快地构建 REACT

    如果您的 Webpack 构建缓慢且有大量的库 -- 别担心,有一种方法可以提高增量构建的速度!Webpack 的 DLLPlugin 允许您将所有的依赖项构建到一个文件中.这是一个取代分块的很好选择 ...

  9. 即将取代Maven和Gradle的新一代更强更快的构建工具(至尊典藏版)

    目录 前言 1.介绍 2.安装 3.使用 3.1. 从GitHub下载压缩包 3.2. 解压并配置环境变量 3.3.测试 4.总结 前言 大家好,我是程序缘--幻羽,我又来了!! Maven和Grad ...

最新文章

  1. Spring基础专题——第八章(事务)
  2. 开源播放器 ijkplayer (四) :Ijkplayer切换网络时停止播放的问题处理
  3. laravel在wamp中输入地址后总是无法访问
  4. 清理linux内存cache
  5. js判断鼠标旋转度数以及顺逆方向详解
  6. Ansible系列之roles使用说明
  7. [渝粤教育] 中国地质大学 电路理论(新) 复习题 (2)
  8. pyqt5与html数据交互原理,pyqt5与本地html进行js交互
  9. 【HUAWEI Mate30】抽奖啦!华为IoT新福利上线!
  10. 60-140-040-使用-DataSink-Data Sink 介绍
  11. java 对象和类
  12. UVA 11806 Cheerleaders (容斥原理)
  13. mysql资源限制_超出了MariaDB / MySQL资源限制
  14. DSP存储器与寄存器管理
  15. 【微信小程序】使用vant组件库(count-down)实现倒计时
  16. 考研政治(二):马克思主义基本原理
  17. cocoa和cocoa Touch的区别
  18. SDL_ttf库显示字体
  19. 计算机内部如何防止溢出,电脑提示堆栈溢出是什么意思 该怎么解决
  20. php随机给文字拼音,给文字加上拼音_php

热门文章

  1. Cognos安装详解
  2. FME爬取高德POI数据
  3. IO测试软件–orion
  4. 什么是 HTTP 协议
  5. 我的Android进阶之旅:经典的大牛博客推荐
  6. DB2数据库的简单介绍和用法,编程序技巧
  7. (转)《黑客帝国完全解析》
  8. 刀剑斗神传只显示11个服务器,与官方服务器互通 《刀剑斗神传》电脑版即将上线...
  9. 项目管理大会演讲PPT
  10. 安装Nvidia的PS插件后无法打开DDS文件格式