解决webpack5上使用art-template出现“can‘t resoleve ‘....\lib\runtime.js‘“错误的办法

前言

我是一个新手,在webpack使用art-template时,出现了"can’t resoleve ‘…\lib\runtime.js’''的问题,研究了很久很久,不得不说,百度这个东西除了搜索套娃文章和广告,真是…啥也不是.

问题描述

在webpack使用art-template编译时,出现了类似如下错误:

ERROR in   Error: Child compilation failed:
  Module not found: Error: Can't resolve '..\..\node_modules\art-template\lib\runtime.js' in 'D:\xxx\xxx\xxxx'
  Did you mean './..\..\node_modules\art-template\lib\runtime.js'?
  Requests that should resolve in the current directory need to start with './'.
  Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
	......

当时看上去可能是路径或者node_modules出现了问题, 经过多次测试排除, 又换webpack和art-template版本…一系列操作后总结发现三点问题:

  1. 所有art文件在根目录第一层文件夹下,比如’./src/xxx.art’, 或者’./components/xxx.art’,就不会出错.
  2. 问题只出现在新版webpack上,也有可能是template,或
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值