最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】ant-design-mobile配置webpack出错:configuration.resolve.extensions[0] should not be empty

Webpack crifan 2938浏览 0评论

折腾:

【记录】去试用Ant Design的UI

期间,去给webpack加了配置,解决了:

【已解决】ant-design-mobile配置webpack出错:configuration.resolve has an unknown property modulesDirectories

对于改动后的:

    extensions: [”, ‘.web.js’, ‘.jsx’, ‘.js’, ‘.json’, ‘.less’],

又出现了:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
– configuration.resolve.extensions[0] should not be empty.

configuration.resolve.extensions[0] should not be empty

Getting error: configuration.resolve.extensions[0] should not be empty · Issue #3043 · webpack/webpack

去掉””

或改为:”*”

或改为:’*’

javascript – Why does webpack need an empty extension – Stack Overflow

webpack学习篇一 从 v1 迁移到 v2 丨 智杰之家 – 关注互联网开发

去掉空字符串即可

Webpack: Error: configuration.resolve.extensions[0] should not be empty – Michelle Liu

改为:

extensions: [‘*’, ‘.js’, ‘.es6’]

javascript – webpack 2 cannot resolve empty extensions – Stack Overflow

【总结】

把:

extensions: [”, ‘.web.js’, ‘.jsx’, ‘.js’, ‘.json’, ‘.less’],

去改为:

extensions: [‘*’, ‘.web.js’, ‘.jsx’, ‘.js’, ‘.json’, ‘.less’],

结果:

即可消除此警告,希望真的是可以正常加载了没有后缀的文件。

转载请注明:在路上 » 【已解决】ant-design-mobile配置webpack出错:configuration.resolve.extensions[0] should not be empty

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.158 seconds, using 22.12MB memory