Git Product home page Git Product logo

zuzuchefe / guido Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 7.0 7.87 MB

适用于cmd amd react jquery sass handlebars开发体系的构建工具,内置静态资源(样式、图片)内联外链、自动化雪碧图、资源to base64、资源文件注入模板、dev server、自定义路由等构建、调试、打包部署功能,减少同体系开发环境的重复配置

License: MIT License

JavaScript 99.51% Dockerfile 0.16% CSS 0.33%
build-tool compiler css es2015 es6 guido handlebars javascript-modules javascript-tools svg web-performance webpack2 webpack3

guido's People

Contributors

khronosleung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

guido's Issues

v4.0.0

同步 [email protected] 更新,顺便重构代码

Base Config

  • 路径配置(paths)
  • webpack.config.base
  • eslintFormatter配置

ENV Run Script

Production Mode

  • run node api
  • webpack.config.prod

Development Mode

  • run node api
  • webpack.config.dev
  • webpackDevServer.config

Module Types Feat

Script

  • babel
  • uglify
  • eslint
  • thread?

Styles

  • scss
  • inline mode、url mode
  • css modules
  • autoprefixer
  • 雪碧图 from css code
  • svg2font from css code
  • extract-text-webpack-plugin => mini-css-extract-plugin

Image

  • inline mode、url mode
  • <=8kb 强制inline mode
  • image-webpack-loader

Handlebars

  • helperDirspartialDirs 配置
  • inlineRequires 规则

Fonts

  • ttf|eot|woff|woff2 字体文件处理

SVG

  • SVG Sprite generator for react
  • SVG Sprite generator without react
  • SVG inline mode and url mode
  • SVG 压缩

html-webpack-plugins

  • 资源按需、按模式替换注入
  • 验证2.x的性能问题是否还存在?=> [email protected]

外部扩展

  • browserslist
  • uglifyjs
  • eslint

思考

内配置模式

好处

  • 手脚架升级方便
  • 安装即用,配置一致,产出结果一致,减少差异化

坏处

  • 外部扩展灵活性低,需从内部实现
  • 有可能出现内外部配置冲突情况

生成预设配置模式

好处

  • 灵活性高,开发者可自行根据需求自行任意修改

坏处

  • 无法统一配置及后续升级

建议__sprite可以分组打包

比如

.icon-level-1 {
  background-image: url(../images/level-1.png?__sprite1); //参数形式可以另外定
}
.icon-level-2 {
  background-image: url(../images/level-2.png?__sprite1);
}
.icon-level-3 {
  background-image: url(../images/level-2.png?__sprite2);
}

生成

.icon-level-1 {
  background-image: url(images/sprite-bbb.png);
  xxx
}
.icon-level-2 {
  background-image: url(images/sprite-bbb.png);
  xxx
}
.icon-level-3 {
  background-image: url(images/sprite-aaa.png);
  xxx
}

有时候可以避免首屏的图标载入太慢。
或者有特殊模块可以另外载入处理

v3.1.0

Feature

  • 构建性能提升(happpack)
  • html-webpack-plugin支持自定义配置传入

Bugfix

  • server模式下,模板的js不做 ?__inline 处理

Autoprefixer的browsers配置项警告

文档:https://github.com/postcss/autoprefixer#options

Replace Autoprefixer browsers option to Browserslist config.
Use browserslist key in package.json or .browserslistrc file.

Using browsers option cause some error. Browserslist config
can be used for Babel, Autoprefixer, postcss-normalize and other tools.

If you really need to use option, rename it to overrideBrowserslist.

Learn more at:
https://github.com/browserslist/browserslist#readme
https://twitter.com/browserslist

新功能计划

  • 完美支持全局安装
  • babel支持自定义配置

.....

v4.0.0 发布了吗?

  1. v4.0.0 发布了吗, 可用于生产环境了?

  2. v4里是可以扩展guido的webpack配置了?
    createWebpackConfig.js

if (TypeOf.isObject(appWebpackConfig)) {
	config = mergeWebpackConfig(config, appWebpackConfig);
	config = addModules(config);
} else if (TypeOf.isFunction(appWebpackConfig)) {
	config = addModules(config);
	config = appWebpackConfig(config);
}

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.