@cmmn/tools 1.7.3 → 1.7.6
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/bundle/rollup.config.js
CHANGED
|
@@ -83,7 +83,7 @@ export class ConfigCreator {
|
|
|
83
83
|
entryFileNames: this.getOutputFileName(module, this.options.minify),
|
|
84
84
|
// file: output,
|
|
85
85
|
dir: this.outDir,
|
|
86
|
-
sourcemap: this.options.minify ?
|
|
86
|
+
sourcemap: this.options.minify ? true : 'inline',
|
|
87
87
|
format: module,
|
|
88
88
|
globals: module === 'umd' ? (Array.isArray(this.options.external) ? Object.fromEntries(this.options.external.map(x => [x, x])) : this.options.external) : [],
|
|
89
89
|
assetFileNames: "assets/[name][extname]",
|
|
@@ -187,9 +187,7 @@ export class ConfigCreator {
|
|
|
187
187
|
namedExports: false,
|
|
188
188
|
autoModules: true,
|
|
189
189
|
}) : */
|
|
190
|
-
|
|
191
|
-
// autoModules: true,
|
|
192
|
-
// }),
|
|
190
|
+
Styles(this),
|
|
193
191
|
|
|
194
192
|
string({
|
|
195
193
|
include: /\.(html|svg|less)$/,
|
|
@@ -202,7 +200,7 @@ export class ConfigCreator {
|
|
|
202
200
|
result.unshift(alias({
|
|
203
201
|
entries: Object.entries(this.options.alias).map(([key, value]) => ({
|
|
204
202
|
find: key,
|
|
205
|
-
replacement: value
|
|
203
|
+
replacement: value.replace('<root>', this.root)
|
|
206
204
|
}))
|
|
207
205
|
}));
|
|
208
206
|
}
|
package/compile/tsconfig.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"module": "esnext",
|
|
4
4
|
"moduleResolution": "Node",
|
|
5
|
-
"target": "
|
|
5
|
+
"target": "ES2020",
|
|
6
6
|
"composite": true,
|
|
7
7
|
"sourceMap": false,
|
|
8
8
|
"baseUrl": "./",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"DOM"
|
|
32
32
|
],
|
|
33
33
|
"plugins": [
|
|
34
|
-
{
|
|
35
|
-
"transform": "@cmmn/tools/plugins/absolute-plugin.cjs",
|
|
36
|
-
"after": true
|
|
37
|
-
},
|
|
38
34
|
// Transform paths in output .js files
|
|
39
35
|
{
|
|
40
36
|
"transform": "typescript-transform-paths"
|
|
41
37
|
},
|
|
38
|
+
{
|
|
39
|
+
"transform": "@cmmn/tools/plugins/absolute-plugin.cjs",
|
|
40
|
+
"after": true
|
|
41
|
+
},
|
|
42
42
|
// Transform paths in output .d.ts files (Include this line if you output declarations files)
|
|
43
43
|
{
|
|
44
44
|
"transform": "typescript-transform-paths",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmmn/tools",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6",
|
|
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": "
|
|
87
|
+
"gitHead": "5667a4b6048613ebe1f40ea8a68ee344c79b534c"
|
|
88
88
|
}
|
|
@@ -17,7 +17,7 @@ function visitExportNode(exportNode, sourceFile) {
|
|
|
17
17
|
const relFile = path.relative(absSource, abs).replaceAll(path.sep, '/');
|
|
18
18
|
return ts.updateExportDeclaration(exportNode, exportNode.decorators, exportNode.modifiers, exportNode.exportClause, ts.createStringLiteral(relFile), exportNode.typeOnly);
|
|
19
19
|
}
|
|
20
|
-
if (fs.existsSync(abs + '.ts')) {
|
|
20
|
+
if (fs.existsSync(abs + '.ts') || fs.existsSync(abs + '.tsx')) {
|
|
21
21
|
return ts.updateExportDeclaration(exportNode, exportNode.decorators, exportNode.modifiers, exportNode.exportClause, ts.createStringLiteral(file + '.js'), exportNode.typeOnly);
|
|
22
22
|
}
|
|
23
23
|
if (fs.existsSync(abs + '/')) {
|
|
@@ -39,7 +39,7 @@ function visitImportNode(importNode, sourceFile, options) {
|
|
|
39
39
|
}
|
|
40
40
|
if (/\.(json|tsx?|jsx?)$/.test(file))
|
|
41
41
|
return;
|
|
42
|
-
if (fs.existsSync(abs + '.ts')) {
|
|
42
|
+
if (fs.existsSync(abs + '.ts') || fs.existsSync(abs + '.tsx')) {
|
|
43
43
|
return ts.updateImportDeclaration(importNode, importNode.decorators, importNode.modifiers, importNode.importClause, ts.createStringLiteral(file + '.js'));
|
|
44
44
|
}
|
|
45
45
|
if (fs.existsSync(abs + '/')) {
|