@ixon-cdk/static-builder 1.0.0-alpha.9 → 1.0.0-rc.0

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 (3) hide show
  1. package/browser.js +8 -8
  2. package/index.js +15 -13
  3. package/package.json +2 -2
package/browser.js CHANGED
@@ -1,5 +1,5 @@
1
- const path = require("path");
2
- const { build } = require("vite");
1
+ const path = require('path');
2
+ const { build } = require('vite');
3
3
  const {
4
4
  getRootDir,
5
5
  cleanDir,
@@ -7,7 +7,7 @@ const {
7
7
  writeDemoFile,
8
8
  copyAssets,
9
9
  watchAssets,
10
- } = require("@ixon-cdk/core");
10
+ } = require('@ixon-cdk/core');
11
11
 
12
12
  async function _build(inputFile, outputFile, tag, assets, production, watch) {
13
13
  const inputDir = path.dirname(path.join(getRootDir(), inputFile));
@@ -18,12 +18,12 @@ async function _build(inputFile, outputFile, tag, assets, production, watch) {
18
18
 
19
19
  const config = {
20
20
  root: getRootDir(),
21
- mode: production ? "production" : "development",
21
+ mode: production ? 'production' : 'development',
22
22
  build: {
23
23
  lib: {
24
24
  entry: inputFile,
25
- formats: ["iife"],
26
- name: "app",
25
+ formats: ['iife'],
26
+ name: 'app',
27
27
  fileName: () => `${tag}.min.js`,
28
28
  },
29
29
  sourcemap: true,
@@ -53,7 +53,7 @@ async function _build(inputFile, outputFile, tag, assets, production, watch) {
53
53
  build(config);
54
54
  }
55
55
  });
56
- process.on("SIGINT", () => {
56
+ process.on('SIGINT', () => {
57
57
  process.exit();
58
58
  });
59
59
  }
@@ -65,7 +65,7 @@ module.exports = function runBuild(
65
65
  tag,
66
66
  assets,
67
67
  production = true,
68
- watch = false
68
+ watch = false,
69
69
  ) {
70
70
  return _build(inputFile, outputFile, tag, assets, production, watch);
71
71
  };
package/index.js CHANGED
@@ -1,24 +1,26 @@
1
1
  try {
2
- require("module-alias/register");
3
- } catch {}
2
+ require('module-alias/register');
3
+ } catch {
4
+ // do nothing
5
+ }
4
6
 
5
- const fs = require("fs");
6
- const path = require("path");
7
- const isPotentialCustomElementName = require("is-potential-custom-element-name");
8
- const { getArgv, getRootDir, logErrorMessage } = require("@ixon-cdk/core");
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+ const isPotentialCustomElementName = require('is-potential-custom-element-name');
10
+ const { getArgv, getRootDir, logErrorMessage } = require('@ixon-cdk/core');
9
11
 
10
12
  function main() {
11
13
  const argv = getArgv();
12
14
  const buildTarget = argv._[0];
13
15
  const tag = argv._[1];
14
- const input = argv.input;
15
- const output = argv.output || "dist/bundle/main.min.js";
16
- const assets = JSON.parse(argv.assets || "[]");
16
+ const { input } = argv;
17
+ const output = argv.output || 'dist/bundle/main.min.js';
18
+ const assets = JSON.parse(argv.assets || '[]');
17
19
  const watch = !!argv.watch;
18
20
 
19
21
  if (!input) {
20
22
  logErrorMessage(
21
- "Must supply an input file, relative to the workspace root."
23
+ 'Must supply an input file, relative to the workspace root.',
22
24
  );
23
25
  process.exit();
24
26
  }
@@ -30,13 +32,13 @@ function main() {
30
32
 
31
33
  if (!isPotentialCustomElementName(tag)) {
32
34
  logErrorMessage(
33
- `Custom element name '${tag}' is invalid. See https://html.spec.whatwg.org/multipage/custom-elements.html#prod-potentialcustomelementname`
35
+ `Custom element name '${tag}' is invalid. See https://html.spec.whatwg.org/multipage/custom-elements.html#prod-potentialcustomelementname`,
34
36
  );
35
37
  process.exit();
36
38
  }
37
39
 
38
- if (buildTarget === "browser") {
39
- require("./browser")(input, output, tag, assets, true, watch);
40
+ if (buildTarget === 'browser') {
41
+ require('./browser')(input, output, tag, assets, true, watch);
40
42
  }
41
43
  }
42
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixon-cdk/static-builder",
3
- "version": "1.0.0-alpha.9",
3
+ "version": "1.0.0-rc.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "",
@@ -10,6 +10,6 @@
10
10
  "vite": "^2.6.12"
11
11
  },
12
12
  "peerDependencies": {
13
- "@ixon-cdk/core": "^1.0.0-alpha.9"
13
+ "@ixon-cdk/core": "^1.0.0-rc.0"
14
14
  }
15
15
  }