@pi-r/rollup 0.6.5 → 0.6.7

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.
Files changed (2) hide show
  1. package/index.js +5 -7
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -20,7 +20,7 @@ async function getPlugins(plugin) {
20
20
  }
21
21
  return [];
22
22
  }
23
- async function transform(context, value, options) {
23
+ module.exports = async function transform(context, value, options) {
24
24
  context = options.upgrade(context, __dirname);
25
25
  const { baseConfig, pathname, sourceMap, external, supplementChunks, productionRelease } = options;
26
26
  let { outputConfig, sourceFile, sourcesRelativeTo } = options, result = '', outMap;
@@ -47,7 +47,7 @@ async function transform(context, value, options) {
47
47
  if ((0, types_1.isArray)(baseConfig.plugins)) {
48
48
  baseConfig.plugins = util.loadPlugins(baseConfig.plugins);
49
49
  }
50
- if (esmData?.sourceFile) {
50
+ if (esmData === null || esmData === void 0 ? void 0 : esmData.sourceFile) {
51
51
  const files = [];
52
52
  let tempDir;
53
53
  for (const [inputFile, content, localFile] of esmData.sourceFile) {
@@ -65,8 +65,8 @@ async function transform(context, value, options) {
65
65
  sourcesRelativeTo = esmData.sourcesRelativeTo;
66
66
  }
67
67
  else {
68
- if (!sourceFile || esmData?.code) {
69
- fs.writeFileSync(sourceFile = path.join((sourcesRelativeTo = esmData?.sourcesRelativeTo) || createDir(), (0, types_1.generateUUID)()), esmData?.code || value);
68
+ if (!sourceFile || (esmData === null || esmData === void 0 ? void 0 : esmData.code)) {
69
+ fs.writeFileSync(sourceFile = path.join((sourcesRelativeTo = esmData === null || esmData === void 0 ? void 0 : esmData.sourcesRelativeTo) || createDir(), (0, types_1.generateUUID)()), (esmData === null || esmData === void 0 ? void 0 : esmData.code) || value);
70
70
  tmp.push(sourceFile);
71
71
  }
72
72
  baseConfig.input = sourceFile;
@@ -210,6 +210,4 @@ async function transform(context, value, options) {
210
210
  }
211
211
  return result;
212
212
  }
213
- }
214
-
215
- module.exports = transform;
213
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/rollup",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "rollup transform function for E-mc.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -20,8 +20,8 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/pi-r#readme",
22
22
  "dependencies": {
23
- "@e-mc/document": "^0.8.6",
24
- "@e-mc/types": "^0.8.6",
25
- "rollup": "^4.12.0"
23
+ "@e-mc/document": "^0.8.8",
24
+ "@e-mc/types": "^0.8.8",
25
+ "rollup": "^4.13.2"
26
26
  }
27
27
  }