diff --git a/package.json b/package.json index f6e28ca994976c..53e5a5700523ec 100644 --- a/package.json +++ b/package.json @@ -183,7 +183,7 @@ "react-test-renderer": "^18.2.0", "remark": "^13.0.0", "rimraf": "^5.0.1", - "rollup": "^2.79.1", + "rollup": "^3.27.0", "rollup-plugin-babel": "^4.4.0", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-node-globals": "^1.4.0", diff --git a/packages/mui-material/package.json b/packages/mui-material/package.json index c1407d73a40457..7afc0539e9d377 100644 --- a/packages/mui-material/package.json +++ b/packages/mui-material/package.json @@ -32,7 +32,7 @@ "build:modern": "node ../../scripts/build.mjs modern", "build:node": "node ../../scripts/build.mjs node", "build:stable": "node ../../scripts/build.mjs stable", - "build:umd": "cross-env BABEL_ENV=stable rollup -c scripts/rollup.config.js", + "build:umd": "cross-env BABEL_ENV=stable rollup -c scripts/rollup.config.mjs", "build:copy-files": "node ../../scripts/copyFiles.mjs", "build:types": "node ../../scripts/buildTypes.mjs", "prebuild": "rimraf build tsconfig.build.tsbuildinfo", diff --git a/packages/mui-material/scripts/rollup.config.js b/packages/mui-material/scripts/rollup.config.mjs similarity index 96% rename from packages/mui-material/scripts/rollup.config.js rename to packages/mui-material/scripts/rollup.config.mjs index bf9c5210451e08..e80f63e3c5032e 100644 --- a/packages/mui-material/scripts/rollup.config.js +++ b/packages/mui-material/scripts/rollup.config.mjs @@ -1,4 +1,5 @@ import { promises as fs, existsSync } from 'fs'; +import * as url from 'url'; import path from 'path'; import zlib from 'zlib'; import { promisify } from 'util'; @@ -9,6 +10,8 @@ import replace from '@rollup/plugin-replace'; import nodeGlobals from 'rollup-plugin-node-globals'; import { terser } from 'rollup-plugin-terser'; +const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url)); + const gzip = promisify(zlib.gzip); /** @@ -77,7 +80,7 @@ function sizeSnapshot(options) { function resolveNestedImport(packageFolder, importee) { const folder = importee.split('/')[2]; const resolvedFilename = path.resolve( - __dirname, + currentDirectory, `../../../packages/${packageFolder}/src/${folder}/index`, ); @@ -124,7 +127,7 @@ const babelOptions = { // We are using @babel/plugin-transform-runtime runtimeHelpers: true, extensions: ['.js', '.ts', '.tsx'], - configFile: path.resolve(__dirname, '../../../babel.config.js'), + configFile: path.resolve(currentDirectory, '../../../babel.config.js'), }; const commonjsOptions = { ignoreGlobal: true, diff --git a/yarn.lock b/yarn.lock index 70af7bdbad1711..c8a83c3ce29895 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14513,10 +14513,10 @@ rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.8.1: dependencies: estree-walker "^0.6.1" -rollup@^2.79.1: - version "2.79.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" - integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== +rollup@^3.27.0: + version "3.27.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.27.0.tgz#15bd07e2e1cbfa9255bf6a3f04a432621c2f3550" + integrity sha512-aOltLCrYZ0FhJDm7fCqwTjIUEVjWjcydKBV/Zeid6Mn8BWgDCUBBWT5beM5ieForYNo/1ZHuGJdka26kvQ3Gzg== optionalDependencies: fsevents "~2.3.2"