@rettangoli/fe 0.0.7-rc11 → 0.0.7-rc13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rettangoli/fe",
3
- "version": "0.0.7-rc11",
3
+ "version": "0.0.7-rc13",
4
4
  "description": "Frontend framework for building reactive web components",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/cli/build.js CHANGED
@@ -30,12 +30,12 @@ export const writeViewFile = (view, category, component) => {
30
30
  };
31
31
 
32
32
  export const bundleFile = async (options) => {
33
- const { outfile = "./vt/static/main.js" } = options;
33
+ const { outfile = "./vt/static/main.js", development = false } = options;
34
34
  await esbuild.build({
35
35
  entryPoints: ["./.temp/dynamicImport.js"],
36
36
  bundle: true,
37
- minify: false,
38
- sourcemap: true,
37
+ minify: !development,
38
+ sourcemap: !!development,
39
39
  outfile: outfile,
40
40
  format: "esm",
41
41
  loader: {
@@ -47,7 +47,7 @@ export const bundleFile = async (options) => {
47
47
  const buildRettangoliFrontend = async (options) => {
48
48
  console.log("running build with options", options);
49
49
 
50
- const { dirs = ["./example"], outfile = "./vt/static/main.js", setup = "setup.js" } = options;
50
+ const { dirs = ["./example"], outfile = "./vt/static/main.js", setup = "setup.js", development = false } = options;
51
51
 
52
52
  const allFiles = getAllFiles(dirs).filter((filePath) => {
53
53
  return (
@@ -130,7 +130,7 @@ Object.keys(imports).forEach(category => {
130
130
 
131
131
  writeFileSync("./.temp/dynamicImport.js", output);
132
132
 
133
- await bundleFile({ outfile });
133
+ await bundleFile({ outfile, development });
134
134
 
135
135
  console.log(`Build complete. Output file: ${outfile}`);
136
136
  };
package/src/cli/watch.js CHANGED
@@ -66,7 +66,10 @@ const startWatching = async (options) => {
66
66
 
67
67
  // Do initial build with all directories
68
68
  console.log('Starting initial build...');
69
- await buildRettangoliFrontend(options);
69
+ await buildRettangoliFrontend({
70
+ development: true,
71
+ ...options
72
+ });
70
73
  console.log('Initial build complete');
71
74
 
72
75
  dirs.forEach(dir => {