webclipper / web-clipper

For Notion,OneNote,Bear,Yuque,Joplin。Clip anything to anywhere
https://clipper.website
Other
6.14k stars 554 forks source link

`npm run dev` webpack打包报错 #1296

Closed yqs112358 closed 3 months ago

yqs112358 commented 3 months ago

Bug 描述

master分支,使用pnpm安装所有依赖后跑npm run dev编译打包,webpack报错:

ERROR in ./node_modules/.pnpm/antd@4.16.3_react-dom@17.0.2_react@17.0.2/node_modules/antd/dist/antd.less 1:0
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> @import "../lib/style/index.less";
| @import "../lib/style/components.less";
 @ ./src/pages/app.tsx 1:0-29
 @ ./src/main/tool.main.chrome.ts

复现步骤

安装Node v20.16.0 LTS,安装pnpm,执行pnpm install安装所有依赖,启动测试服务器进行编译

预期行为

编译过程无报错

截图

8482948fe744d86f80d25a91e282e758

yqs112358 commented 3 months ago

补充:似乎只有win下有此问题,wsl下一切正常

DiamondYuan commented 3 months ago

补充:似乎只有win下有此问题,wsl下一切正常

include: /node_modules\/antd|@ant-design|@formily/

应该是 webpack 这里没匹配上导致的。

yqs112358 commented 3 months ago

直接改成include: /node_modules/可以嘛?我在win下试了一下可以正常pack,也没有什么性能影响