@pi-r/rollup 0.6.5 → 0.7.0
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/README.md +3 -6
- package/index.js +6 -8
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
### @pi-r/rollup
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
https://e-mc.readthedocs.io/en/latest/document/plugins/built-in.html
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- [squared](https://squared.readthedocs.io)
|
|
7
|
-
|
|
8
|
-
## LICENSE
|
|
5
|
+
### LICENSE
|
|
9
6
|
|
|
10
7
|
MIT
|
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;
|
|
@@ -43,7 +43,7 @@ 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
|
|
46
|
+
outputConfig.format ||= format;
|
|
47
47
|
if ((0, types_1.isArray)(baseConfig.plugins)) {
|
|
48
48
|
baseConfig.plugins = util.loadPlugins(baseConfig.plugins);
|
|
49
49
|
}
|
|
@@ -56,7 +56,7 @@ 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
|
|
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);
|
|
@@ -93,8 +93,8 @@ async function transform(context, value, options) {
|
|
|
93
93
|
}
|
|
94
94
|
else {
|
|
95
95
|
if (sourceMap.output.size) {
|
|
96
|
-
outputConfig.sourcemap
|
|
97
|
-
const 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 = () => {
|
|
@@ -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.
|
|
3
|
+
"version": "0.7.0",
|
|
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.
|
|
24
|
-
"@e-mc/types": "^0.
|
|
25
|
-
"rollup": "^4.
|
|
23
|
+
"@e-mc/document": "^0.9.0",
|
|
24
|
+
"@e-mc/types": "^0.9.0",
|
|
25
|
+
"rollup": "^4.16.4"
|
|
26
26
|
}
|
|
27
27
|
}
|