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

Taro 3.6.26 中配置 cssMinimizer 为 esbuild 时打包失败 #15578

Open
SexySix opened this issue Apr 24, 2024 · 0 comments
Open

Taro 3.6.26 中配置 cssMinimizer 为 esbuild 时打包失败 #15578

SexySix opened this issue Apr 24, 2024 · 0 comments
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@SexySix
Copy link

SexySix commented Apr 24, 2024

相关平台

微信小程序

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

复现步骤

使用taro-cli 3.6.26 新建项目,选择默认模版,运行 npm run build:weapp

期望结果

打包成功

实际结果

打包失败

✖ Errors:

Error: pages/index/index.wxss from Css Minimizer plugin
Error: Transform failed with 1 error:
/Users/joestea/study/esbuild-demo/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:256:12: ERROR: Invalid option in transform() call: "preset"

 ELIFECYCLE  Command failed with exit code 1.

环境信息

👽 Taro v3.6.26


  Taro CLI 3.6.26 environment info:
    System:
      OS: macOS 14.3
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 16.20.2 - ~/.nvm/versions/node/v16.20.2/bin/node
      Yarn: 1.22.22 - ~/.nvm/versions/node/v16.20.2/bin/yarn
      npm: 8.19.4 - ~/.nvm/versions/node/v16.20.2/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.26 => 3.6.26 
      @tarojs/components: 3.6.26 => 3.6.26 
      @tarojs/helper: 3.6.26 => 3.6.26 
      @tarojs/plugin-framework-react: 3.6.26 => 3.6.26 
      @tarojs/plugin-platform-alipay: 3.6.26 => 3.6.26 
      @tarojs/plugin-platform-h5: 3.6.26 => 3.6.26 
      @tarojs/plugin-platform-jd: 3.6.26 => 3.6.26 
      @tarojs/plugin-platform-qq: 3.6.26 => 3.6.26 
      @tarojs/plugin-platform-swan: 3.6.26 => 3.6.26 
      @tarojs/plugin-platform-tt: 3.6.26 => 3.6.26 
      @tarojs/plugin-platform-weapp: 3.6.26 => 3.6.26 
      @tarojs/react: 3.6.26 => 3.6.26 
      @tarojs/runtime: 3.6.26 => 3.6.26 
      @tarojs/shared: 3.6.26 => 3.6.26 
      @tarojs/taro: 3.6.26 => 3.6.26 
      @tarojs/taro-loader: 3.6.26 => 3.6.26 
      @tarojs/webpack5-runner: 3.6.26 => 3.6.26 
      babel-preset-taro: 3.6.26 => 3.6.26 
      eslint-config-taro: 3.6.26 => 3.6.26 
      react: ^18.0.0 => 18.2.0 

补充信息

image `packages/taro-webpack5-runner/src/webpack/WebpackPlugin.ts` 第77行 此处传入的选项中包含了 `preset` 字段 image `esbuild` 会对传入字段进行验证,由于 `preset`字段不是esbuild能接受的字段,因此报错
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Apr 24, 2024
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-3 Version - 3.x
Projects
Status: Todo
Development

No branches or pull requests

1 participant