@cmmn/tools 1.7.11 → 1.7.19

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.
@@ -212,7 +212,7 @@ export class ConfigCreator {
212
212
  }
213
213
  if (this.options.minify && this.options.mount){
214
214
  const toCopy = Object.entries(this.options.mount).map(([to, from]) => {
215
- return {src: from, dest: join(this.outDir, to)}
215
+ return {src: from + '/*', dest: join(this.outDir, to)}
216
216
  });
217
217
  result.push(copy({
218
218
  targets: toCopy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmmn/tools",
3
- "version": "1.7.11",
3
+ "version": "1.7.19",
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": "1861dc80b2959b3a727f55174195cec7227b36fb"
87
+ "gitHead": "b08ae10090bc0a5a160131e6c435a9092c019829"
88
88
  }
@@ -26,14 +26,16 @@ function visitExportNode(exportNode, sourceFile) {
26
26
  }
27
27
  }
28
28
 
29
- function visitImportNode(importNode, sourceFile, options) {
29
+ function visitImportNode(importNode, sourceFile, options, context) {
30
30
  const file = importNode.moduleSpecifier?.text;
31
31
  if (!file || !file.startsWith('.'))
32
32
  return;
33
+ const caseSensitiveFileNames = context.getEmitHost().useCaseSensitiveFileNames();
34
+ const formatPath = caseSensitiveFileNames ? x => x : x => x.toLowerCase();
33
35
  const sourceFileDir = path.dirname(sourceFile.path);
34
- const abs = path.resolve(sourceFileDir, file);
36
+ const abs = formatPath(path.resolve(sourceFileDir, formatPath(file)));
35
37
  if (/\.(less|css|scss|sass|svg|png|html)$/.test(file)) {
36
- const absSource = path.join(options.outDir, path.relative(options.baseUrl, sourceFileDir));
38
+ const absSource = formatPath(path.join(options.outDir, formatPath(path.relative(options.baseUrl, sourceFileDir))));
37
39
  const relFile = path.relative(absSource, abs).replaceAll(path.sep, '/');
38
40
  return ts.updateImportDeclaration(importNode, importNode.decorators, importNode.modifiers, importNode.importClause, ts.createStringLiteral(relFile));
39
41
  }
@@ -78,7 +80,7 @@ const lessToStringTransformer = function (context) {
78
80
  return result;
79
81
  }
80
82
  if (ts.isImportDeclaration(node)) {
81
- const result = visitImportNode(node, sourceFile, options);
83
+ const result = visitImportNode(node, sourceFile, options, context);
82
84
  if (result)
83
85
  return result;
84
86
  }