Giter Club home page Giter Club logo

pipeline-template's Introduction

pipeline-template

页面可视化搭建框架的页面模板

用法

初始化

# 初始化项目(安装依赖包)
npm i

本地测试

npm start

生成模板

  • 生成服务端渲染所需代码
$ npm run server

打包结果在server目录中。

  • 验证服务端渲染可用

服务端渲染对代码写法是有一些要求的, 比如不允许使用 window/document 这种浏览器特有对象. 所以可以本地执行服务端渲染来验证服务端渲染是否正常.

$ npm run render
  • 生成模板压缩包
$ npm run server
$ npm run template

打包结果为pipeline-template.zip, 提交模板时, 提交该 zip 文件.

个性化页面独立发布

拉取一个独立分支或一份独立源码, 然后

$ npm run build

打包结果在dist目录中。

服务端渲染脚本

路径 server/node.js

用于在 node 服务端渲染出带 DOM 元素的 index.html.

渲染发布版本 默认

$ node server/node.js release

渲染页面预览版本

嵌入了模板生成页面的调试脚本

$ node server/node.js preview

TODO

  • 基础样式的引入方式
  • 模板打包为压缩包脚本
  • 组件开发套件
  • 组件抽离为 npm 包
  • schema 和 data 的验证页面

前后端同构已知问题

页面基本配置的更新在本地 dev 模式下无法实时渲染

因为页面基本配置base-config.json, 是在获取 webpack 构建参数时候引入给 html-webpack-plugin 的, 属于 webpack-dev-tool 的一部分, 所以文件变化时, webpack-dev-tool 并不会重新引入该文件.

好在: 需要调试页面基本配置的场景比较少.

EOF

pipeline-template's People

Contributors

cntchen avatar

Watchers

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