After some time in development, we are pleased to introduce Remax 2.0, which supports building Web applications.

Support Web application construction

Thanks to the design of Remax One, applications built on Remax One can now compile to the Web side by using the following command:

$ remax build -t web

Through this CodeSandbox can experience (may need a ladder) : https://codesandbox.io/s/remax-web-e4801

Build a Web application specific document: https://remaxjs.org/guide/one/web

Build using Webpack

In 1.0, Remax used Rollup as the underlying build tool. The reason is that when building the applet code, all we have to do is deal with module dependencies and some code transformations, and the Rollup itself is very clean and easy to use, so we can quickly implement the functionality we need.

However, by default, only ES Modules are supported by Rollup. While Rollup-plugin-CommonJS works for most CommonJS Modules, there are some NPM packages that are not very formal and can cause problems.

Rollup also falls short when it comes to building Web applications, such as Code Splitting and Dev Server.

So in 2.0 we switched from Rollup to Webpack in order to unify building tools for applets and Web applications.

Plug-in mechanism

In order to meet various customization requirements, we introduced a plug-in mechanism in 2.0. For non-core functions, we will provide them as plug-ins. For example, we can configure our Less plug-ins in remax.config.js.

const less = require('@remax/plugin-less');

module.exports = {
  plugins: [less()],
};

Plug-in related documents: https://remaxjs.org/guide/advanced/plugin

A dependency

Starting with 2.0, projects rely on only one package, Remax.

Automatically recognize CSS Modules

Remax will automatically recognize CSS Modules. For example, this will automatically recognize index. CSS as CSS Modules:

import styles from './index.css';

CSS is automatically treated as a global CSS if it is written as follows:

import './index.css';

Rename alipay to ali

REMAX supports all Ali applets, so we use Ali instead for Ali applets.

See our CHANGELOG for more details on the changes.