@cmmn/tools 1.6.18 → 1.6.24

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.
@@ -6,8 +6,9 @@ import {string} from "rollup-plugin-string";
6
6
  import serve from 'rollup-plugin-serve';
7
7
  import builtins from 'rollup-plugin-node-builtins';
8
8
  import livereload from 'rollup-plugin-livereload';
9
+ import copy from 'rollup-plugin-copy';
9
10
  import fs from "fs";
10
- import path from "path";
11
+ import path, {join} from "path";
11
12
  import html from '@open-wc/rollup-plugin-html';
12
13
  import json from '@rollup/plugin-json';
13
14
  import alias from '@rollup/plugin-alias';
@@ -110,7 +111,7 @@ export class ConfigCreator {
110
111
  if (!this.options.minify) {
111
112
  const importMaps = Object.fromEntries(this.options.external
112
113
  .map(key => key.replace('.*', '/'))
113
- .map(key => [key, `/external/${this.options.alias[key] ?? key}`]));
114
+ .map(key => [key, `/external/${this.options.alias?.[key] ?? key}`]));
114
115
  inject = `<script type="importmap" >${JSON.stringify({
115
116
  imports: importMaps
116
117
  })}</script>` + inject;
@@ -202,6 +203,14 @@ export class ConfigCreator {
202
203
  }))
203
204
  }));
204
205
  }
206
+ if (this.options.minify && this.options.mount){
207
+ const toCopy = Object.entries(this.options.mount).map(([to, from]) => {
208
+ return {src: from, dest: join(this.outDir, to)}
209
+ });
210
+ result.push(copy({
211
+ targets: toCopy
212
+ }));
213
+ }
205
214
  if (this.options.html || this.options.input.endsWith('.html')) {
206
215
  result.push(this.html);
207
216
  result.push(watcher([path.join(this.root, this.options.html)]))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmmn/tools",
3
- "version": "1.6.18",
3
+ "version": "1.6.24",
4
4
  "description": "Compilation, bundling, code generator, testing.",
5
5
  "main": "dist/rollup.config.js",
6
6
  "type": "module",
@@ -63,6 +63,7 @@
63
63
  "postcss-import": "14",
64
64
  "postcss-modules": "*",
65
65
  "rollup": "^2",
66
+ "rollup-plugin-copy": "3",
66
67
  "rollup-plugin-livereload": "^2.0.5",
67
68
  "rollup-plugin-node-builtins": "^2.1.2",
68
69
  "rollup-plugin-node-globals": "^1.4.0",
@@ -81,5 +82,5 @@
81
82
  },
82
83
  "author": "",
83
84
  "license": "ISC",
84
- "gitHead": "7976c62383cca9ab395c5162989d467452c769f7"
85
+ "gitHead": "0826ee58578f567fc9eec12b9ab2aef9d0b3e8a2"
85
86
  }