Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taro2.2.13 项目打包后wxml未压缩 #7483

Closed
xwJin opened this issue Aug 31, 2020 · 3 comments
Closed

taro2.2.13 项目打包后wxml未压缩 #7483

xwJin opened this issue Aug 31, 2020 · 3 comments
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-2 Version - 2.x

Comments

@xwJin
Copy link

xwJin commented Aug 31, 2020

相关平台

微信小程序

小程序基础库: 2.1.12
使用框架: React

复现步骤

taro2.2.13 模板项目,taro build --type weapp打包后,生成的dist目录wxml未压缩

期望结果

wxml文件压缩

实际结果

wxml稳健未压缩

环境信息

Taro CLI 2.2.13 environment info:
    System:
      OS: macOS 10.14.1
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.14.1 - /usr/local/bin/node
      Yarn: 1.16.0 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 2.2.13 => 2.2.13 
      @tarojs/components-qa: 2.2.13 => 2.2.13 
      @tarojs/mini-runner: 2.2.13 => 2.2.13 
      @tarojs/plugin-less: 2.2.13 => 2.2.13 
      @tarojs/plugin-terser: 2.2.13 => 2.2.13 
      @tarojs/redux: 2.2.13 => 2.2.13 
      @tarojs/redux-h5: 2.2.13 => 2.2.13 
      @tarojs/router: 2.2.13 => 2.2.13 
      @tarojs/taro: 2.2.13 => 2.2.13 
      @tarojs/taro-alipay: 2.2.13 => 2.2.13 
      @tarojs/taro-h5: 2.2.13 => 2.2.13 
      @tarojs/taro-qq: 2.2.13 => 2.2.13 
      @tarojs/taro-quickapp: 2.2.13 => 2.2.13 
      @tarojs/taro-swan: 2.2.13 => 2.2.13 
      @tarojs/taro-tt: 2.2.13 => 2.2.13 
      @tarojs/taro-weapp: 2.2.13 => 2.2.13 
      @tarojs/webpack-runner: 2.2.13 => 2.2.13 
      eslint-config-taro: 2.2.13 => 2.2.13 
      eslint-plugin-taro: 2.2.13 => 2.2.13 
      nerv-devtools: ^1.5.5 => 1.5.7 
      nervjs: ^1.5.5 => 1.5.7 
      stylelint-config-taro-rn: 2.2.13 => 2.2.13 
      stylelint-taro-rn: 2.2.13 => 2.2.13

补充信息

希望帮忙解答下如何压缩wxml文件~

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-2 Version - 2.x labels Aug 31, 2020
@Chen-jj
Copy link
Contributor

Chen-jj commented Aug 31, 2020

@wxjin Taro2 没有实现这个功能,Taro 3 有个配置可以配。其实也就是使用 html-webpack-plugin 去处理一下。

但小程序模板不像 html,可以压缩的基本上只有空格,你可以详细看 html-webpack-plugin 压缩配置,能压个 10k 左右已经不错了,不是很必要。

@xchunzhao
Copy link

@xwJin Taro2 可以使用 minify-wxml-plugin 插件,确实压缩的效果不是很好,能压缩的只有空格。

@yuuk
Copy link
Contributor

yuuk commented Jul 28, 2022

能使用小程序自带的上传压缩wxml功能么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-2 Version - 2.x
Projects
None yet
Development

No branches or pull requests

5 participants