@cmmn/tools 1.7.9 → 1.7.10

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.
@@ -37,6 +37,7 @@ export class ConfigCreator {
37
37
  * browser: boolean,
38
38
  * dedupe: string[],
39
39
  * target: string
40
+ * inject: string
40
41
  * }}
41
42
  */
42
43
  options;
@@ -103,7 +104,9 @@ export class ConfigCreator {
103
104
  dir: this.outDir,
104
105
  inject: false,
105
106
  template: (x) => {
106
- let inject = Object.keys(x.bundle.bundle).map(key => {
107
+ let inject = (this.options.inject === "json") ? `<script>
108
+ globalThis.assets = ${JSON.stringify(Object.keys(x.bundle.bundle))};
109
+ </script>`: Object.keys(x.bundle.bundle).map(key => {
107
110
  if (key.endsWith('css'))
108
111
  return `<link rel="stylesheet" href="${this.options.base ?? ''}/${key}" >`;
109
112
  if (key.endsWith('js'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmmn/tools",
3
- "version": "1.7.9",
3
+ "version": "1.7.10",
4
4
  "description": "Compilation, bundling, code generator, testing.",
5
5
  "main": "dist/rollup.config.js",
6
6
  "type": "module",
@@ -84,5 +84,5 @@
84
84
  },
85
85
  "author": "",
86
86
  "license": "ISC",
87
- "gitHead": "cc0a2c6abf53317c5e9597c3e4f541ecc5f4bfc7"
87
+ "gitHead": "cf56c770e5aa17b665d5a5617871b7fad2c0be66"
88
88
  }