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

创建团队站点,webpack打包报错 #87

Open
lixuquan opened this issue Dec 7, 2023 · 1 comment
Open

创建团队站点,webpack打包报错 #87

lixuquan opened this issue Dec 7, 2023 · 1 comment

Comments

@lixuquan
Copy link

lixuquan commented Dec 7, 2023

在使用 arco-cli 创建组件库并尝试创建团队站点时,遇到了 webpack 打包错误。

以下是问题的详细描述:

通过 arco init projectName 新建项目,项目类型是组件库。
项目建立好后根据 README.md 文档,新增一个 Button 组件并运行 dev
打开后 storybook 提示没找到配置的stories文件,检查下,去修改了 .storybook/main.js

stories: [path.resolve(isMonorepo ? 'packages/*' : './', 'stories/*.@(js|jsx|ts|tsx)')],
//  修改成
stories: ['../stories/*.@(js|jsx|ts|tsx)'],

storybook 可以正常预览。

后面按照官网文档搭建团队站点

cd projectName
arco init arco-team-site --pure

初始化完成后修改配置是“可用于 Arco 物料库模板的配置”,然后运行 yarn dev 发现无法打包,具体错误:

ERROR in ./.temp/submodule/component.js 8:0-68
Module not found: Error: Can't resolve '......componentsButtondemoindex.js' in 'D:\projects\test-design\arco-team-site\.temp\submodule'
 @ ./.temp/index.zh-CN.js 3:0-64 18:13-32

ERROR in ./.temp/submodule/component.js 9:0-62
Module not found: Error: Can't resolve '......componentsButtonREADME.md' in 'D:\projects\test-design\arco-team-site\.temp\submodule'
 @ ./.temp/index.zh-CN.js 3:0-64 18:13-32

ERROR in D:projectstest-designcomponentsButtonstyleindex.less
Module build failed: UnhandledSchemeError: Reading from "D:projectstest-designcomponentsButtonstyleindex.less" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.

再去检查项目中具体文件

// arco-team-site/.temp/submodule/component.js

/* Do NOT edit this file manually, it's generated by arco-material-doc-site. */
/* eslint-disable */

// Import demos and document of Button
import * as _Button from '..\..\..\components\Button\demo\index.js';
import _ButtonDoc from '..\..\..\components\Button\README.md';
import 'D:\projects\test-design\components\Button\style\index.less';


// Export Modules
export const Button = { ..._Button, _SITE_DOC: _ButtonDoc };

像是webpack配置的错误,模块路径不对了,请问是什么问题导致的呢,该怎么解决。

环境

  • OS: windows11
  • arco-cli: v1.27.5
  • node version v16.20.2
@catitcs
Copy link

catitcs commented Jun 17, 2024

一样的 the same
OS: Windows 11 专业版 23H2
arco-cli: v1.27.5
node version v20.14.0

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