Skip to content

[Bug]: webpack报错找不到模块 unplugin-tailwindcss-mangle/dist/core/loader.cjs #141

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

Closed
vcup opened this issue Feb 19, 2025 · 1 comment · Fixed by #142
Closed

[Bug]: webpack报错找不到模块 unplugin-tailwindcss-mangle/dist/core/loader.cjs #141

vcup opened this issue Feb 19, 2025 · 1 comment · Fixed by #142
Assignees
Labels
bug Something isn't working

Comments

@vcup
Copy link

vcup commented Feb 19, 2025

version

v4.0.6

Link to minimal reproduction

https://www.npmjs.com/package/unplugin-tailwindcss-mangle/v/4.0.6?activeTab=code

Steps to reproduce

报错消息如下

Error: Cannot find module 'C:/miniprogram/node_modules/.pnpm/unplugin-tailwindcss-mangle@4.0.6_rollup@3.29.5/node_modules/unplugin-tailwindcss-mangle/dist/core/loader.cjs'

查找这里提到的core/loader.cjs,发现路径在该文件中定义

const WEBPACK_LOADER = path.resolve(__dirname, __DEV__ ? '../../dist/core/loader.cjs' : 'core/loader.cjs')

在查找了以前的npm包的内容之后,发现至少到v3.0.1,该文件都还是存在的。
版本进入到v4.0.0之后,整个 core/ 文件夹都不在dist/中了,这是正常的现象吗。如果v4.0.0之后确实移除了该文件,怎么会在webpack的loader中使用它?

module.loaders.splice(idx, 0, {
loader: WEBPACK_LOADER,
ident: null,
options: {
ctx,
},
type: null,
})

What is expected?

安装的包中应该带有dist/core/loader.cjs

What is actually happening?

在v4.0.0之后就没有dist/core/loader.cjs了,既然有引用该路径,该文件应该存在

System Info

Any additional comments?

No response

@vcup vcup added the bug Something isn't working label Feb 19, 2025
@vcup vcup changed the title [Bug]: webpack报错找不到模块 [Bug]: webpack报错找不到模块 unplugin-tailwindcss-mangle/dist/core/loader.cjs Feb 19, 2025
@sonofmagic
Copy link
Owner

是的,目录结构变化,把这个不小心干掉了,我修一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants