Replace deprecated terser plugin (#1423)

* Replace deprecated terser plugin

* Update Node version

* Fix build on windows

* Use path resolve instead of posix

---------

Co-authored-by: robo-mop <realaryanpingle@gmail.com>
This commit is contained in:
Surma
2024-08-19 08:50:41 +01:00
committed by GitHub
parent 5f72c2ed74
commit e8d35e0fb6
6 changed files with 239 additions and 32 deletions

View File

@@ -10,12 +10,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { posix as pathUtils, isAbsolute } from 'path';
import { posix, isAbsolute, resolve } from 'path';
export default function resolveDirs(paths) {
const pathBaseDir = paths.map((path) => [
pathUtils.basename(path),
pathUtils.dirname(path),
posix.basename(path),
posix.dirname(path),
]);
return {
@@ -31,7 +31,7 @@ export default function resolveDirs(paths) {
throw new Error(`Couldn't find ${'./' + id}`);
}
if (isAbsolute(resolveResult.id)) return resolveResult.id;
return pathUtils.resolve(resolveResult.id);
return resolve(resolveResult.id);
},
};
}