GithubHelp home page GithubHelp logo

dazjean / srejs Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 5.0 2.78 MB

Server rendering engine 缩写为 srejs 即服务器端渲染引擎,为React,Vue提供轻量级封装的服务端渲染骨架。提供了类似模板引擎一样的用法用于在Koa框架中使用。

Home Page: https://umajs.gitee.io/%E6%9C%8D%E5%8A%A1%E7%AB%AF%E6%B8%B2%E6%9F%93/React-ssr.html

License: MIT License

JavaScript 58.30% HTML 4.45% SCSS 2.22% TypeScript 20.28% Less 2.72% CSS 1.13% Vue 4.50% Smarty 6.40%

srejs's People

Contributors

akai-cn avatar bubblem avatar dazjean avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

srejs's Issues

FAQ

按需加载第三方组件库(antd-mobile, Ant Design,element-ui

antd 默认支持基于 ES module 的 tree shaking,不使用babel-import-plugin插件也会有按需加载的效果。

  • react组件库(antd-mobile, Ant Design

.bablerc文件修改如下

{
    "plugins": [
        ["import", {
            "libraryName": "cheui-react",
            "libraryDirectory": "lib/components",
            "camel2DashComponentName": true 
        },"cheui-react"],
        ["import", {
            "libraryName": "antd-mobile",
            "libraryDirectory": "lib"
        },"antd-mobile"]
    ]
}
  • vue组件库(Element-UI ,ant-design-vue

.bablerc文件修改如下

{
    "plugins": [
      [
        "component",
        {
          "libraryName": "element-ui",
          "styleLibraryName": "theme-chalk"
        }
      ],
      ["import", { "libraryName": "ant-design-vue", "libraryDirectory": "lib" }]
    ]
}

第三方组件库使用ES modules时编译失败

为了加快项目构建速度,框架默认为webpack配置依赖的bable-loader添加了exclude: /node_modules/,当某个第三方组件库使用es模式移入时,需要覆盖webpack配置或者将组件库从node_modules中提取出来作为项目文件引入。

  • 覆盖webpack配置

dart-sass编译警告

Deprecation Warning: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($px, $baseFontSize)

More info and automated migrator: https://sass-lang.com/d/slash-div

  ╷
5 │   @return $px / $baseFontSize * 1rem;
  │           ^^^^^^^^^^^^^^^^^^^
  ╵
    web/pages/verify/static/css/fun.scss 5:11  rem()
    stdin 4:17                                 root stylesheet

node-sass升级成使用dart-sass之后,有部分sass语法不兼容警告,可通过包 sass-migrator自动修复

npm -i sass-migrator -g
sass-migrator division ./**/*.scss

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.