Code Monkey home page Code Monkey logo

wenke's Introduction

wenke

NPM

NPM version

wenke 是为搜狗社区搜索部业务线产品定制开发的, 基于webpack、Gulp、React、Vue.js、Babel等开源项目的前端自动化构建工具。

特别说明:此为对外版本,主要是介绍wenke解决方案,完整的解决方案介绍请访问: 搜狗社区搜索前端工程化解决方案简介,内部版本功能更为完善。

安装

npm install -g wenke

使用说明

wenke -w 后端模板文件目录(同时处理多个工程请用"," 英文逗号分隔) -s 静态资源文件目录

目录规范说明

js文件引入规范

在后端模板中引入的JS主要有3种情况:

  1. 直接引入CDN中的JS, 这种引入方法会被 wenke 排除在编译列表之外;

  2. 业务共用库, 例如:

    <script src="http://local.wenwen.sogou.com/src/js/lib/wenke/entry.js"></script>
    
  3. 具体页面入口JS文件, 例如:

    <script src="http://local.wenwen.sogou.com/deploy/js/project1/wenke/wenke/bundle.js"></script>
    

** 注意: **

  1. 页面入口文件名必须为: main.js
  2. 地址中的src必须修改为deploy, 这样主要是为了避免svn识别src目录下实时编译产生的中间文件

后端模板文件目录

后端模板文件目录下必须要有src目录,例如后端模板文件目录为view的话,如下:

view
└─src

构建后的后端模板文件会放置在与src同级目录下的deploy目录,无需用户手动创建,构建时会自动建立,编译后的目录结构如下:

view
├─deploy
└─src  

静态资源文件目录

静态资源根目录下必须要有src目录,例如静态资源根目录为static的话,如下:

static
└─src

构建后的静态资源会放置在与src同级目录下的deploy目录,无需用户手动创建,构建时会自动建立,编译后的目录结构如下:

static
├─deploy
└─src  

demo说明

cd切换至demo目录, 执行如下命令即可看到运行结果:

wenke -w ./demo/server -s ./demo/static

命令行参数说明

-s 必需

静态资源文件目录

-w 必需

后端模板文件目录

--cdn-root-dir-name

静态资源文件发布所在的CDN目录

--debug-domain

调试时的静态资源文件域名前缀

--deploy-domain

JS、CSS文件CDN域名前缀

--img-deploy-domain

图片类型文件CDN域名前缀

--local

只进行本地编译, 不上传静态资源文件到CDN

Report an issue

欢迎大家将使用wenke中遇到的任何问题提交给我,提问地址:Report an issue

Pull Requests

如果您发现了代码中的问题,可以 New pull request


如果wenke对您有帮助,欢迎打赏:)

欢迎打赏

License

wenke 使用 MIT License

wenke's People

Contributors

mopduan avatar

Watchers

James Cloos avatar  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.