I have a project that was created with create-react-app
and has been "ejected". For my use-case, I need to update the Webpack config to output files to the ./build
directory in the development environment, like it does in production.
I added a devServer
property to my config:
devServer: {
writeToDisk: true,
}
and I updated the output
property to have a path
in the development environment:
// I changed this:
output: {
path: isEnvProduction ? paths.appBuild : undefined,
...
}
// To this:
output: {
path: paths.appBuild,
...
}
When I run yarn start
, no files are written to the build
directory.
What should I be doing differently?