From: A SOUL <59335580+140948940@users.noreply.github.com> Date: Wed, 8 Mar 2023 19:45:03 +0000 (+0800) Subject: chore: modify the way to get __dirname (#1727) [skip ci] X-Git-Tag: v4.2.0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92e3f111930ed5f28ac8a4c7ede383f13961c18e;p=thirdparty%2Fvuejs%2Frouter.git chore: modify the way to get __dirname (#1727) [skip ci] Co-authored-by: Eduardo San Martin Morote --- diff --git a/packages/router/rollup.config.mjs b/packages/router/rollup.config.mjs index d4b1f2d9..a0dd7b38 100644 --- a/packages/router/rollup.config.mjs +++ b/packages/router/rollup.config.mjs @@ -1,17 +1,17 @@ import path from 'node:path' +import { fileURLToPath } from 'node:url' import { promises as fsp } from 'node:fs' -import {dirname} from 'node:path' import ts from 'rollup-plugin-typescript2' import replace from '@rollup/plugin-replace' import resolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import chalk from 'chalk' import pkg from './package.json' assert { type: 'json' } -import {terser} from 'rollup-plugin-terser' +import { terser } from 'rollup-plugin-terser' const name = pkg.name -const __dirname = dirname(new URL(import.meta.url).pathname) +const __dirname = path.dirname(fileURLToPath(import.meta.url)) const banner = `/*! * ${pkg.name} v${pkg.version}