Browse Source

watch live-editor

Gregg Tavares 6 years ago
parent
commit
bcb295fe9d
1 changed files with 9 additions and 1 deletions
  1. 9 1
      Gruntfile.js

+ 9 - 1
Gruntfile.js

@@ -76,6 +76,7 @@ module.exports = function(grunt) {
         files: [
         files: [
           'threejs/**',
           'threejs/**',
           '3rdparty/**',
           '3rdparty/**',
+          'node_modules/@gfxfundamentals/live-editor/src/**',
         ],
         ],
         tasks: ['copy'],
         tasks: ['copy'],
         options: {
         options: {
@@ -97,10 +98,17 @@ module.exports = function(grunt) {
   let changedFiles = {};
   let changedFiles = {};
   const onChange = grunt.util._.debounce(function() {
   const onChange = grunt.util._.debounce(function() {
     grunt.config('copy.main.files', Object.keys(changedFiles).filter(noMds).map((file) => {
     grunt.config('copy.main.files', Object.keys(changedFiles).filter(noMds).map((file) => {
-      return {
+      const copy = {
         src: file,
         src: file,
         dest: 'out/',
         dest: 'out/',
       };
       };
+      if (file.indexOf('live-editor') >= 0) {
+        copy.cwd = `${path.dirname(file)}/`;
+        copy.src = path.basename(file);
+        copy.expand = true;
+        copy.dest = 'out/webgl/resources/';
+      }
+      return copy;
     }));
     }));
     grunt.config('buildlesson.main.files', Object.keys(changedFiles).filter(mdsOnly).map((file) => {
     grunt.config('buildlesson.main.files', Object.keys(changedFiles).filter(mdsOnly).map((file) => {
       return {
       return {