Added React base app
This commit is contained in:
parent
1ddb4febe8
commit
d37bb398dd
21 changed files with 11688 additions and 0 deletions
28
frontend/scripts/watch.js
Normal file
28
frontend/scripts/watch.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
process.env.NODE_ENV = 'development';
|
||||
|
||||
const fs = require('fs-extra');
|
||||
const paths = require('react-scripts/config/paths');
|
||||
const webpack = require('webpack');
|
||||
const config = require('react-scripts/config/webpack.config.js');
|
||||
|
||||
// removes react-dev-utils/webpackHotDevClient.js at first in the array
|
||||
config.entry.shift();
|
||||
|
||||
webpack(config).watch({}, (err, stats) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
} else {
|
||||
copyPublicFolder();
|
||||
}
|
||||
console.error(stats.toString({
|
||||
chunks: false,
|
||||
colors: true
|
||||
}));
|
||||
});
|
||||
|
||||
function copyPublicFolder() {
|
||||
fs.copySync(paths.appPublic, paths.appBuild, {
|
||||
dereference: true,
|
||||
filter: file => file !== paths.appHtml
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue