今天在build项目的时候报:

ReferenceError: resolve is not defined

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! yingyi@1.0.0 build: cross-env NODE_ENV=production webpack --progress --hide-modules
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the yingyi@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersyingyiAppDataRoamingnpm-cache_logs2018-05-21T11_19_19_460Z-debug.log

查了一些文档发现是缺少辅助函数,在webpack的配置文件中加上就好了

function resolve (dir) {
return path.join(__dirname, '..', dir)
}

使用vue-cli+webpack搭建的项目一般都有这个,如果是自己单引入的配置文件可能会报这个错,推荐使用脚手架工具搭建环境。

最新文章

  1. MindMup 是一个开源的、在线的、简单的思维导图工具
  2. BZOJ4078 : [Wf2014]Metal Processing Plant
  3. Android Programming: Pushing the Limits -- Chapter 7:Android IPC -- ApiWrapper
  4. angularjs select 循环中出现第一个 option 为空格问题
  5. JQuery知识快览之三—JQuery对象集
  6. 几种Menu和几种对话框
  7. PHP程序的一次重构记录
  8. Application.DoEvents()的作用
  9. Zabbix appliance One Stop
  10. java代码示例(6-3)
  11. Day7 错误和异常
  12. diff 命令实用
  13. Markdown总结整理
  14. [python]pip 版本9.0.1升级到10.0.1故障解决办法
  15. SP8093 JZPGYZ - Sevenk Love Oimaster 解题报告
  16. 一、Django的简介
  17. ILMerge-GUI的使用
  18. HTML 教程
  19. mac MyEclipse2017 CI10安装破解心得
  20. TimeQuest学习总结

热门文章

  1. CBV加装饰器解决登录注册问题和 <<中间件>>
  2. 3.1.6 循环栅栏:CyclicBarrier
  3. ceph常用指令
  4. HDU 6096 String (AC自动机)
  5. CodeForces 342B Xenia and Spies (水题模拟,贪心)
  6. Boost学习之语法解析器--Spirit
  7. C#延迟执行
  8. ZookeeperGettingStarted
  9. C++ springf()的用法(转)
  10. Backup--如何快速截断日志