mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 07:04:31 +00:00
Disable sloc in watch mode
This commit is contained in:
parent
a576059055
commit
54917cc6a8
2 changed files with 34 additions and 1 deletions
|
@ -39,7 +39,7 @@ module.exports = {
|
|||
{
|
||||
apply: (compiler) => {
|
||||
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {
|
||||
exec('node scripts/copy-to-examples.js', (err, stdout, stderr) => {
|
||||
exec('node scripts/copy-to-examples-watch.js', (err, stdout, stderr) => {
|
||||
if (stdout) process.stdout.write(stdout);
|
||||
if (stderr) process.stderr.write(stderr);
|
||||
});
|
||||
|
|
33
scripts/copy-to-examples-watch.js
Normal file
33
scripts/copy-to-examples-watch.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
let fs = require('fs-extra');
|
||||
|
||||
let source = './build/phaser.js';
|
||||
let sourceMap = './build/phaser.js.map';
|
||||
let dest = '../phaser3-examples/public/build/dev.js';
|
||||
let destMap = '../phaser3-examples/public/build/phaser.js.map';
|
||||
|
||||
if (fs.existsSync(dest))
|
||||
{
|
||||
fs.copy(sourceMap, destMap, function (err) {
|
||||
|
||||
if (err)
|
||||
{
|
||||
return console.error(err);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
fs.copy(source, dest, function (err) {
|
||||
|
||||
if (err)
|
||||
{
|
||||
return console.error(err);
|
||||
}
|
||||
|
||||
console.log('Build copied to ' + dest);
|
||||
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('Copy-to-Examples failed: Phaser 3 Examples not present at ../phaser3-examples');
|
||||
}
|
Loading…
Reference in a new issue