@polylith/builder 0.2.21 → 0.2.22

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 +7 -4
  2. package/package.json +1 -1
package/App.js CHANGED
@@ -32,7 +32,8 @@ export default class App {
32
32
  * Construct the app object.
33
33
  *
34
34
  * @param {String} name a name for the app
35
- * @param {Object} config
35
+ * @param {Object} config polylith configuration file
36
+ * @param {Object} setup
36
37
  * @property {String} root the full path to the root directory of the project.
37
38
  * All other paths will be relative to this path.
38
39
  * @proprty {String} index the relative path to the main source file from the
@@ -45,9 +46,11 @@ export default class App {
45
46
  * @property {String} testDest the relative path to the testing destination
46
47
  * folder from the root for rolled up files
47
48
  */
48
- constructor(name, config) {
49
- var {root, index, dest, spec, testDest=''} = config;
49
+ constructor(name, config, setup) {
50
+ var {root, index, dest, spec, testDest=''} = setup;
50
51
 
52
+ this.polylithConfig = config;
53
+ this.setup = setup;
51
54
  root = forceToPosix(root);
52
55
  this.root = root;
53
56
  this.routerRoot = '/' + name;
@@ -734,7 +737,7 @@ export default class App {
734
737
  watchLog(),
735
738
  ];
736
739
 
737
- if (env !== 'dev') plugins.push(terser());
740
+ if (this.polylithConfig.minify) plugins.push(terser());
738
741
 
739
742
  if (this.liveReload) {
740
743
  let plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polylith/builder",
3
- "version": "0.2.21",
3
+ "version": "0.2.22",
4
4
  "description": "The polylith builder",
5
5
  "main": "index.js",
6
6
  "type": "module",