@polylith/builder 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/App.js CHANGED
@@ -17,6 +17,7 @@ import features from './plugin-features.js';
17
17
  import resources from "./plugin-copy-resources.js";
18
18
  import jsconfig from "./plugin-jsconfig.js";
19
19
  import loadConfigs from "./plugin-config.js";
20
+ import watchLog from "./plugin-watch.js";
20
21
 
21
22
  import {forceToPosix, fileExists} from './utils.js'
22
23
  import ConfigFeature from './ConfigFeature.js';
@@ -130,7 +131,7 @@ export default class App {
130
131
  }
131
132
 
132
133
  async sendIndex(res) {
133
- var indexPath = path.join(this.root, this.htmlTemplate.destination);
134
+ var indexPath = path.join(this.root, this.htmlTemplate.source);
134
135
  res.sendFile(indexPath)
135
136
  }
136
137
 
@@ -704,7 +705,8 @@ export default class App {
704
705
  destination: this.htmlTemplate.destination,
705
706
  templateVars: this.templateVariables,
706
707
  }),
707
- resources(this.name, this.files, false)
708
+ resources(this.name, this.files, false),
709
+ watchLog(),
708
710
  ];
709
711
 
710
712
  if (this.liveReload) {
@@ -808,7 +810,6 @@ export default class App {
808
810
 
809
811
  const watcher = rollup.watch(watchConfig);
810
812
  watcher.on('event', function(event) {
811
- console.log(event.code);
812
813
  if (event.result) {
813
814
  event.result.close();
814
815
  }
@@ -818,11 +819,11 @@ export default class App {
818
819
  }
819
820
 
820
821
  if (event.code === 'BUNDLE_START') {
821
- // console.log(event);
822
+ console.log('building...')
822
823
  }
823
824
 
824
825
  if (event.code === 'BUNDLE_END') {
825
- // console.log(event);
826
+ console.log('build complete')
826
827
  }
827
828
  }.bind(this));
828
829
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polylith/builder",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "The polylith builder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,10 @@
1
+ export default function watch() {
2
+ return {
3
+ name: 'watch-log',
4
+
5
+ watchChange(id, type) {
6
+ console.log(`${type} of file ${id}`)
7
+ return null;
8
+ }
9
+ };
10
+ }