ts-const-value-transformer 0.7.0 → 0.7.1
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/CHANGELOG.md +4 -0
- package/dist/createPortalTransformer.mjs +3 -1
- package/dist/loader.mjs +4 -4
- package/dist/version.d.mts +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -133,7 +133,9 @@ export default async function createPortalTransformer(options = {}) {
|
|
|
133
133
|
let ts;
|
|
134
134
|
if (options.typescript != null) {
|
|
135
135
|
if (typeof options.typescript === 'string') {
|
|
136
|
-
|
|
136
|
+
// Use eval to avoid webpack warnings
|
|
137
|
+
// eslint-disable-next-line no-eval
|
|
138
|
+
ts = (await eval('import(options.typescript)'));
|
|
137
139
|
}
|
|
138
140
|
else {
|
|
139
141
|
ts = options.typescript;
|
package/dist/loader.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
|
-
import
|
|
2
|
+
import createPortalTransformer, {} from './createPortalTransformer.mjs';
|
|
3
3
|
const transformerMap = new Map();
|
|
4
4
|
const loader = function (content, sourceMap) {
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions, @typescript-eslint/strict-boolean-expressions
|
|
6
6
|
this.cacheable && this.cacheable();
|
|
7
7
|
this.async();
|
|
8
|
-
void
|
|
8
|
+
void (async () => {
|
|
9
9
|
try {
|
|
10
10
|
const options = this.getOptions() || {};
|
|
11
11
|
const project = options.project ?? 'tsconfig.json';
|
|
12
12
|
let transformer = transformerMap.get(project);
|
|
13
13
|
if (!transformer) {
|
|
14
|
-
transformer =
|
|
14
|
+
transformer = await createPortalTransformer({
|
|
15
15
|
cwd: path.dirname(this.resourcePath),
|
|
16
16
|
...options,
|
|
17
17
|
});
|
|
@@ -23,6 +23,6 @@ const loader = function (content, sourceMap) {
|
|
|
23
23
|
catch (e) {
|
|
24
24
|
this.callback(e);
|
|
25
25
|
}
|
|
26
|
-
});
|
|
26
|
+
})();
|
|
27
27
|
};
|
|
28
28
|
export default loader;
|
package/dist/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.7.
|
|
1
|
+
declare const _default: "0.7.1";
|
|
2
2
|
export default _default;
|
package/dist/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '0.7.
|
|
1
|
+
export default '0.7.1';
|