【发布时间】:2018-10-12 22:58:04
【问题描述】:
我想用Spring构建应用并做出反应,所以我开始学习这个教程:https://github.com/spring-guides/tut-react-and-spring-data-rest/tree/master/basic
我的项目包含相同的文件 - 我是一步一步完成的(刚刚分享了我的项目以寻求帮助 https://github.com/Lewan110/rest-react)。 Spring Data rest 运行良好,因为我得到了正确的数据,但是当我转到 http://localhost:8080 时,我没有得到任何数据,并且 bundle.js 出现错误
这对我来说很奇怪,因为 bundle.js 是在以下位置生成的:\src\main\resources\static\built\bundle.js webpack.config.js 看起来也不错:
var path = require('path');
module.exports = {
entry: './src/main/js/app.js',
devtool: 'sourcemaps',
cache: true,
debug: true,
output: {
path: __dirname,
filename: './src/main/resources/static/built/bundle.js'
},
module: {
loaders: [
{
test: path.join(__dirname, '.'),
exclude: /(node_modules)/,
loader: 'babel',
query: {
cacheDirectory: true,
presets: ['es2015', 'react']
}
}
]
}
};
我是 React(和 JS)的新手,我不知道原因在哪里。
【问题讨论】:
标签: javascript spring reactjs spring-boot