Wxapp Boilerplate

screenshot of Wxapp Boilerplate
scss

使用 webpack, babel, scss 开发的微信/支付宝小程序项目脚手架

Overview:

The wxapp-boilerplate is a project scaffold for developing WeChat and Alipay mini programs using webpack, babel, and SCSS. It provides functionality such as support for importing node_modules modules, avoiding long module paths using aliases, and ensuring compatibility with ES6 features. It also includes useful SCSS mixins and extends, global constants for development assistance, and automatic compilation for both WeChat and Alipay mini programs. The installation process requires Node.js (>= v4.2) and either yarn or npm.

Features:

  • Webpack and Babel: Utilizes webpack and babel for module bundling and transpiling ES6 features.
  • SCSS Support: Allows for writing .wxss files using SCSS syntax and provides built-in mixins and extends.
  • Global Constants: Provides global constants like DEV and process.env.NODE_ENV to assist in development.
  • WeChat and Alipay Compatibility: Supports automatic compiling for both WeChat and Alipay mini programs with specific global constants (WECHAT and ALIPAY) for platform differentiation.
  • Command Line Tools: Includes commands for quick creation of WeChat mini program pages and for linting and prettifying the code.
  • File Copying: Addresses the issue of dynamic file imports by including the copy-webpack-plugin for copying files or directories automatically.
  • Compatibility with WeChat and Alipay: Handles platform-specific differences such as wxml to axml conversion, wx:attr to a:attr conversion, and wx API to my API conversion using the global constants WECHAT and ALIPAY.

Summary:

The wxapp-boilerplate is a useful project scaffold for developing WeChat and Alipay mini programs. It includes features such as webpack and babel integration, SCSS support with useful mixins and extends, and global constants for development assistance. The installation process is straightforward, requiring Node.js and either yarn or npm. The project provides commands for starting development servers, building production-ready code, and quickly creating new mini program pages. It also offers solutions for handling platform-specific differences and dynamic file imports. Overall, the wxapp-boilerplate streamlines the development process for WeChat and Alipay mini programs.

scss
SCSS

SCSS is a preprocessor scripting language that extends the capabilities of CSS by adding features such as variables, nesting, and mixins. It allows developers to write more efficient and maintainable CSS code, and helps to streamline the development process by reducing repetition and increasing reusability.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

Stylelint

Stylelint is a modern linter for CSS that helps you avoid errors and enforce consistent styling conventions. It provides rules for detecting errors and warnings, and can be configured to match your specific project's requirements.

webpack
Webpack

Webpack is a popular open-source module bundler for JavaScript applications that bundles and optimizes the code and its dependencies for production-ready deployment. It can also be used to transform other types of assets such as CSS, images, and fonts.