mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-23 18:15:26 +00:00
28 lines
713 B
JavaScript
28 lines
713 B
JavaScript
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
|
|
});
|
|
} |