【发布时间】:2015-12-23 03:02:14
【问题描述】:
有:
我有一个 Django 应用程序。它对前端有反应。我有 2 个 django 应用程序。 movies_list 和 series_list。我在baseapplication/movies_list/interfaces/ 和baseapplication/series_list/interfaces/ 中有我所有的.jsx 文件。 2 个应用程序的入口点在 web-pack.config.js 的 entry 对象中给出 ...../index。
需要:
我需要将编译后的.js 文件放入baseapplication/movies_list/static/movies_list 和baseapplication/series_list/static/series_list 中。所以我需要在entry 中找到每个条目并获取abs 路径并为将来的应用程序动态构建我的output 路径。这将帮助我的python manage.py collectstatic 从每个目录中获取静态文件。
如何配置output 使其动态化?
module.exports = {
//The base directory (absolute path) for resolving the entry option
context: __dirname,
entry: {
movies: '../movies_list/interfaces/index',
series: '../series_list/interfaces/index',
},
output: {
// I need help here.
path: path.join('<', "static"),
//path: path.resolve('../[entry]/static/react_bundles/'),
filename: "[name].js",
},
}
【问题讨论】:
标签: python django node.js reactjs webpack