Git Product home page Git Product logo

kepule's Introduction

kepule 前端

前言

这是一个前端开发的标准,它集成了 样式库 组件库 自动打包 等功能

为此你需要安装一些必要的运行环境

any problems please @csii_shaoyh

enjoy it

2014/9/10 15:21:43

css

css文件结构如下

  • themes
  • default
    • css
      • kepule.css
      • kepule_ie7_fix.css
      • base.css locallize

kepule.css是基础样式库,kepule_ie7_fix.css是为ie7打的补丁包,base.css是localize

example:施工中...

js

js文件结构如下

  • js
    • dev
      • lib
        • angular.min.js
        • es5-shim.min.js
        • jquery-1.11.1.mini.js
        • json3.min.js
        • spin.js
      • module
        • base.js
        • component.js
        • config.js
        • service.js
      • controller
        • projectA
          • ctrlA-1.js
          • ctrlA-2.js
    • pro

js分为 devpro 两部分,日常开发工作在 dev 下进行

lib中包含的是基础js库,module是angular所依赖的模块,controller顾名思义,这里就不做解释啦

example:施工中...

打包

有了gruntjs,前端的打包任务也可以自动化了

来看看根目录下的Gruntfile.js

uglify : {
	options : {
			mangle : true,
			banner : "/** \n"
					+ " * -------------------------------------------------------------\n"
					+ " * @version: <%= pkg.version%> \n"
					+ " * @description: <%= pkg.description%> \n"
					+ " * ------------------------------------------------------------- \n"
					+ " */ \n\n"
	},
	demo: {
			files : [{
				expand: true,
                cwd: "js/dev/module",
                src: ["**/*.js"],
                dest: "js/pro/module"
			}, {
				expand: true,
                cwd: "js/dev/controller",
                src: ["**/*.js"],
                dest: "js/pro/controller"
			}]
	}
},
copy: {
	demo : {
		expand: true,
        cwd: "js/dev/lib",
        src: ["**/*.js"],
        dest: "js/pro/lib"
	}
}

uglify任务:将 js/dev/modulejs/dev/controller 的js文件分别打包至 pro 对应目录下

copy任务:将 js/dev/lib 中的js文件拷贝至 js/pro/lib 目录下

ps

  1. markdown真是好用,这里推荐一下,比word什么的方便省事多了
  2. js和css的例子还在施工中,有兴趣的童鞋帮我一起写,邮箱在留在上面了
  3. css的打包和gzip还没做,童鞋们也可以pull给我哈
  4. 这是个永久测试版,出任何问题了我不负责

kepule's People

Contributors

justbeay avatar syhmosh avatar

Watchers

李术鸿 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.