I followed this tutorial for creating a Spring-boot+ ReactJs app: https://spring.io/guides/tutorials/react-and-spring-data-rest/
The application starts fine with ./mvnw spring-boot: run
, and I have an NPM script "watch": "webpack --watch -d"
that runs the following configuration
var path = require('path');
module.exports = {
entry: './src/main/js/app.js',
devtool: 'sourcemaps',
cache: true,
mode: 'development',
output: {
path: __dirname,
filename: './src/main/resources/static/built/bundle.js'
},
module: {
rules: [
{
test: path.join(__dirname, '.'),
exclude: /(node_modules)/,
use: [{
loader: 'babel-loader',
options: {
presets: ["@babel/preset-env", "@babel/preset-react"]
}
}]
}
]
}
};
app.js
gets compiled into bundle.js
as expected but if I don't restart the server with ./mvnw spring-boot:run
when I refresh the page I can't see the changes.
I might be missing something, is maybe spring-boot not using my bundle.js
file but a copy of some sort?