@polylith/builder 0.2.13 → 0.2.15

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.
Files changed (2) hide show
  1. package/App.js +9 -4
  2. package/package.json +2 -1
package/App.js CHANGED
@@ -131,6 +131,10 @@ export default class App {
131
131
  }
132
132
  }
133
133
 
134
+ getIndexFile() {
135
+ return path.posix.join(this.root, this.htmlTemplate.destination);
136
+ }
137
+
134
138
  async sendIndex(res) {
135
139
  var indexPath = path.posix.join(this.root, this.htmlTemplate.destination);
136
140
  res.sendFile(indexPath);
@@ -161,9 +165,10 @@ export default class App {
161
165
 
162
166
  // also include this process stuff, React seems to think it will always
163
167
  // be there. Consider moving this into a plugin/feature of some sort
168
+ var env = process.env.NODE_ENV || 'dev';
164
169
  var codeBlock =
165
170
  `<script>
166
- window.process = {env: {NODE_ENV: 'dev'}};
171
+ window.process = {env: {NODE_ENV: ${env}}};
167
172
  `;
168
173
 
169
174
  if (names.length !== 0) {
@@ -172,7 +177,7 @@ export default class App {
172
177
  }, this);
173
178
 
174
179
  codeBlock +=
175
- ` window.process = {env: {NODE_ENV: 'dev'}};
180
+ `
176
181
  window.${this.ns} = {
177
182
  ${members.join('\n')}
178
183
  }
@@ -821,11 +826,11 @@ export default class App {
821
826
  }
822
827
 
823
828
  if (event.code === 'BUNDLE_START') {
824
- console.log(cc.set('fg_green', 'building...'));
829
+ console.log(cc.set('fg_blue', 'building...'));
825
830
  }
826
831
 
827
832
  if (event.code === 'BUNDLE_END') {
828
- console.log(cc.set('fg_green', 'build complete'))
833
+ console.log(cc.set('fg_blue', 'build complete'))
829
834
  }
830
835
  }.bind(this));
831
836
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polylith/builder",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "description": "The polylith builder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -20,6 +20,7 @@
20
20
  "@babel/preset-react": "^7.16.7",
21
21
  "@ondohers/console-colors": "^0.1.1",
22
22
  "@polylith/core": "^0.1.9",
23
+ "@polylith/config-store": "0.1.2",
23
24
  "@rollup/plugin-babel": "^5.3.0",
24
25
  "@rollup/plugin-commonjs": "^24.0.0",
25
26
  "@rollup/plugin-json": "^5.0.2",