【发布时间】:2020-10-14 02:00:17
【问题描述】:
我正在尝试将 Vue 和 Django 一起使用,如 this article 中所述。除了 webpack-bundle-tracker 之外,一切似乎都在工作。我很确定 webpack-bundle-tracker 甚至没有安装,因为当我运行 yarn add webpack-bundle-tracker --dev 时会发生这种情况:
yarn add v1.22.4
info No lockfile found.
[1/4] ???? Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/core-js: self signed certificate in certificate chain".
但是,当我运行 npm install --save-dev webpack-bundle-tracker 时,它似乎可以工作?但没有真正改变,也没有生成 webpack-stats.json 文件。
另一件事可能是 django-webpack-loader,因为当我运行 pip install django-webpack-loader 时会发出一堆权限错误,但当我运行 pip install django-webpack-loader --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org 时它起作用了。
当我尝试打开我的 vue/django 测试页面时,django 给我的错误:
Error reading /Users/$ME/Dev/digiproj/vue_frontend/webpack-stats.json. Are you sure webpack has generated the file and the path is correct?
只是不确定从这里去哪里,非常感谢任何帮助。
【问题讨论】:
标签: python node.js django vue.js webpack