@pi-r/rollup 0.3.2 → 0.5.2

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 (4) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/index.js +18 -34
  4. package/package.json +4 -4
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2023 Studio Trigger
1
+ Copyright 2023 Wit Studio
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @pi-r/rollup
2
2
 
3
- PEP 402 - Forever Aina
3
+ PEP 402 - Forever Vivy
4
4
 
5
5
  ## LICENSE
6
6
 
package/index.js CHANGED
@@ -22,10 +22,8 @@ async function getPlugins(plugin) {
22
22
  return [];
23
23
  }
24
24
  async function transform(context, value, options) {
25
- var _a, _b;
26
25
  context = options.upgrade(context, __dirname);
27
26
  const { baseConfig, pathname, sourceMap, external, supplementChunks, productionRelease } = options;
28
- const VERSION = parseFloat(context.VERSION);
29
27
  let { outputConfig, sourceFile, sourcesRelativeTo } = options, result = '', outMap;
30
28
  const esmData = options.getSourceFiles();
31
29
  const format = options.imported ? 'es' : 'iife';
@@ -86,14 +84,8 @@ async function transform(context, value, options) {
86
84
  }
87
85
  };
88
86
  };
89
- let plugins;
90
- if (VERSION >= 3) {
91
- plugins = await getPlugins(baseConfig.plugins);
92
- baseConfig.plugins = plugins;
93
- }
94
- else {
95
- plugins = ((_a = baseConfig).plugins || (_a.plugins = []));
96
- }
87
+ const plugins = await getPlugins(baseConfig.plugins);
88
+ baseConfig.plugins = plugins;
97
89
  plugins.unshift(dynamicImportPlugin());
98
90
  }
99
91
  let url;
@@ -103,24 +95,22 @@ async function transform(context, value, options) {
103
95
  else {
104
96
  if (sourceMap.output.size) {
105
97
  outputConfig.sourcemap || (outputConfig.sourcemap = true);
106
- if (VERSION >= 3) {
107
- const plugins = baseConfig.plugins || (baseConfig.plugins = []);
108
- if (Array.isArray(plugins) && !plugins.includes('rollup-plugin-sourcemaps')) {
109
- let found;
110
- const sourcemapInputPlugin = () => {
111
- return {
112
- name: 'sqd-sourcemap-input',
113
- load(id) {
114
- if (found) {
115
- return Promise.resolve(null);
116
- }
117
- found = id;
118
- return Promise.resolve({ code: sourceMap.code, map: sourceMap.map });
98
+ const plugins = baseConfig.plugins || (baseConfig.plugins = []);
99
+ if (Array.isArray(plugins) && !plugins.includes('rollup-plugin-sourcemaps')) {
100
+ let found;
101
+ const sourcemapInputPlugin = () => {
102
+ return {
103
+ name: 'sqd-sourcemap-input',
104
+ load(id) {
105
+ if (found) {
106
+ return Promise.resolve(null);
119
107
  }
120
- };
108
+ found = id;
109
+ return Promise.resolve({ code: sourceMap.code, map: sourceMap.map });
110
+ }
121
111
  };
122
- plugins.unshift(sourcemapInputPlugin());
123
- }
112
+ };
113
+ plugins.unshift(sourcemapInputPlugin());
124
114
  }
125
115
  }
126
116
  if (outputConfig.sourcemap && outputConfig.sourcemapFile) {
@@ -134,14 +124,8 @@ async function transform(context, value, options) {
134
124
  if (external) {
135
125
  if ('plugins' in external) {
136
126
  if ((0, types_1.isArray)(external.plugins)) {
137
- let plugins;
138
- if (VERSION >= 3) {
139
- plugins = await getPlugins(outputConfig.plugins);
140
- outputConfig.plugins = plugins;
141
- }
142
- else {
143
- plugins = ((_b = outputConfig).plugins || (_b.plugins = []));
144
- }
127
+ const plugins = await getPlugins(outputConfig.plugins);
128
+ outputConfig.plugins = plugins;
145
129
  plugins.push(...util.loadPlugins(external.plugins));
146
130
  }
147
131
  delete external.plugins;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/rollup",
3
- "version": "0.3.2",
3
+ "version": "0.5.2",
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.6.1",
24
- "@e-mc/types": "^0.6.1",
25
- "rollup": "^3.29.4"
23
+ "@e-mc/document": "^0.7.2",
24
+ "@e-mc/types": "^0.7.2",
25
+ "rollup": "^4.12.0"
26
26
  }
27
27
  }