@pi-r/rollup 0.6.7 → 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.
Files changed (3) hide show
  1. package/README.md +3 -6
  2. package/index.js +7 -7
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -1,10 +1,7 @@
1
- # @pi-r/rollup
1
+ ### @pi-r/rollup
2
2
 
3
- ## Documentation
3
+ https://e-mc.readthedocs.io/en/latest/document/plugins/built-in.html
4
4
 
5
- - [E-mc](https://e-mc.readthedocs.io/en/latest/document/plugins/built-in.html)
6
- - [squared](https://squared.readthedocs.io)
7
-
8
- ## LICENSE
5
+ ### LICENSE
9
6
 
10
7
  MIT
package/index.js CHANGED
@@ -43,11 +43,11 @@ module.exports = async function transform(context, value, options) {
43
43
  else if ((0, types_1.isPlainObject)(baseConfig.output)) {
44
44
  outputConfig = Object.assign(baseConfig.output, outputConfig);
45
45
  }
46
- outputConfig.format || (outputConfig.format = format);
46
+ outputConfig.format ||= format;
47
47
  if ((0, types_1.isArray)(baseConfig.plugins)) {
48
48
  baseConfig.plugins = util.loadPlugins(baseConfig.plugins);
49
49
  }
50
- if (esmData === null || esmData === void 0 ? void 0 : esmData.sourceFile) {
50
+ if (esmData?.sourceFile) {
51
51
  const files = [];
52
52
  let tempDir;
53
53
  for (const [inputFile, content, localFile] of esmData.sourceFile) {
@@ -56,7 +56,7 @@ module.exports = async function transform(context, value, options) {
56
56
  if (!content) {
57
57
  continue;
58
58
  }
59
- fs.writeFileSync(targetFile = path.join(localFile && path.dirname(localFile) || (tempDir || (tempDir = createDir())), (0, types_1.generateUUID)()), content);
59
+ fs.writeFileSync(targetFile = path.join(localFile && path.dirname(localFile) || (tempDir ||= createDir()), (0, types_1.generateUUID)()), content);
60
60
  tmp.push(targetFile);
61
61
  }
62
62
  files.push(targetFile || inputFile);
@@ -65,8 +65,8 @@ module.exports = async function transform(context, value, options) {
65
65
  sourcesRelativeTo = esmData.sourcesRelativeTo;
66
66
  }
67
67
  else {
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);
68
+ if (!sourceFile || esmData?.code) {
69
+ fs.writeFileSync(sourceFile = path.join((sourcesRelativeTo = esmData?.sourcesRelativeTo) || createDir(), (0, types_1.generateUUID)()), esmData?.code || value);
70
70
  tmp.push(sourceFile);
71
71
  }
72
72
  baseConfig.input = sourceFile;
@@ -93,8 +93,8 @@ module.exports = async function transform(context, value, options) {
93
93
  }
94
94
  else {
95
95
  if (sourceMap.output.size) {
96
- outputConfig.sourcemap || (outputConfig.sourcemap = true);
97
- const plugins = baseConfig.plugins || (baseConfig.plugins = []);
96
+ outputConfig.sourcemap ||= true;
97
+ const plugins = baseConfig.plugins ||= [];
98
98
  if (Array.isArray(plugins) && !plugins.includes('rollup-plugin-sourcemaps')) {
99
99
  let found;
100
100
  const sourcemapInputPlugin = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/rollup",
3
- "version": "0.6.7",
3
+ "version": "0.7.1",
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.8",
24
- "@e-mc/types": "^0.8.8",
25
- "rollup": "^4.13.2"
23
+ "@e-mc/document": "^0.9.2",
24
+ "@e-mc/types": "^0.9.2",
25
+ "rollup": "^4.18.0"
26
26
  }
27
27
  }