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

使用vite-plugin-html编译时ERROR #3321

Closed
leeseett opened this issue Mar 8, 2022 · 2 comments
Closed

使用vite-plugin-html编译时ERROR #3321

leeseett opened this issue Mar 8, 2022 · 2 comments

Comments

@leeseett
Copy link

leeseett commented Mar 8, 2022

问题描述
vite.config.js 无法使用vite-plugin-html,只要引用这个插件就报错

复现步骤
[复现问题的步骤]

  1. yarn add vite-plugin-html -D
  2. 修改vite.config.js文件,就只引用 import { createHtmlPlugin } from 'vite-plugin-html'
    3.yarn dev:mp-weixin
    image

预期结果
控制台不报错

实际结果
Snipaste_2022-03-08_18-35-03

ERROR (node:30592) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at D:\work\mdmf\jkmf-stand-promotions\node_modules\vuex\package.json.
Update this package.json to use a subpath pattern like "./*".
(Use node --trace-deprecation ... to show where the warning was created)

系统信息:

  • 发行平台: 微信小程序
  • 操作系统 win11
  • uni-app版本 3.0.0-alpha-3040120220307001
@fxy060608
Copy link
Collaborator

  1. 你这个插件小程序平台是不需要的吧?
  2. 错误跟这个插件应该没关系,是因为 vuex 在高版本 node 上的兼容问题
    参考:
    Deprecation Warning: Use of deprecated folder mapping "./" in the "exports" field module vuejs/vuex#2047
    Fix deprecated warning in package.json export module (fix #2047) vuejs/vuex#2048

@leeseett
Copy link
Author

leeseett commented Mar 8, 2022

  1. 你这个插件小程序平台是不需要的吧?
  2. 错误跟这个插件应该没关系,是因为 vuex 在高版本 node 上的兼容问题
    参考:
    Deprecation Warning: Use of deprecated folder mapping "./" in the "exports" field module vuejs/vuex#2047
    Fix deprecated warning in package.json export module (fix #2047) vuejs/vuex#2048
    小程序用不到,H5有用到(就是换个默认的标题)。虽然报ERROR,但是还是能编译通过。我现在不用它了。直接用fs 去修改manifest.json 里边的name字段

@leeseett leeseett closed this as completed Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants