mirror of https://github.com/vuejs/core.git
build(deps): upgrade rollup@2 to rollup@3 (#6990)
* build(deps): upgrade rollup@2 to rollup@3 Signed-off-by: JayFate <37610029@qq.com> * build(rollup): move rollup.config.js to rollup.config.mjs Signed-off-by: JayFate <37610029@qq.com> Signed-off-by: JayFate <37610029@qq.com>
This commit is contained in:
parent
a1099afe1b
commit
f2c46ed9cf
18
package.json
18
package.json
|
@ -56,15 +56,16 @@
|
||||||
"@babel/types": "^7.12.0",
|
"@babel/types": "^7.12.0",
|
||||||
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
|
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
|
||||||
"@microsoft/api-extractor": "~7.20.0",
|
"@microsoft/api-extractor": "~7.20.0",
|
||||||
"@rollup/plugin-commonjs": "^18.0.0",
|
"@rollup/plugin-commonjs": "^23.0.2",
|
||||||
"@rollup/plugin-json": "^4.0.0",
|
"@rollup/plugin-json": "^5.0.1",
|
||||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
"@rollup/plugin-replace": "^2.3.4",
|
"@rollup/plugin-replace": "^5.0.1",
|
||||||
"@types/hash-sum": "^1.0.0",
|
"@types/hash-sum": "^1.0.0",
|
||||||
"@types/jest": "^27.0.1",
|
"@types/jest": "^27.0.1",
|
||||||
"@types/node": "^16.4.7",
|
"@types/node": "^16.4.7",
|
||||||
"@types/puppeteer": "^5.0.0",
|
"@types/puppeteer": "^5.0.0",
|
||||||
"@typescript-eslint/parser": "^5.23.0",
|
"@typescript-eslint/parser": "^5.23.0",
|
||||||
|
"@vue/consolidate": "0.17.3",
|
||||||
"@vue/reactivity": "workspace:*",
|
"@vue/reactivity": "workspace:*",
|
||||||
"@vue/runtime-core": "workspace:*",
|
"@vue/runtime-core": "workspace:*",
|
||||||
"@vue/runtime-dom": "workspace:*",
|
"@vue/runtime-dom": "workspace:*",
|
||||||
|
@ -85,13 +86,14 @@
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"puppeteer": "^10.0.0",
|
"pug": "^3.0.1",
|
||||||
"rollup": "~2.38.5",
|
"puppeteer": "^10.4.0",
|
||||||
|
"rollup": "~3.2.3",
|
||||||
"rollup-plugin-node-builtins": "^2.1.2",
|
"rollup-plugin-node-builtins": "^2.1.2",
|
||||||
"rollup-plugin-node-globals": "^1.4.0",
|
"rollup-plugin-node-globals": "^1.4.0",
|
||||||
"rollup-plugin-polyfill-node": "^0.6.2",
|
"rollup-plugin-polyfill-node": "^0.11.0",
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"rollup-plugin-typescript2": "^0.27.2",
|
"rollup-plugin-typescript2": "^0.34.1",
|
||||||
"semver": "^7.3.2",
|
"semver": "^7.3.2",
|
||||||
"serve": "^12.0.0",
|
"serve": "^12.0.0",
|
||||||
"terser": "^5.15.1",
|
"terser": "^5.15.1",
|
||||||
|
|
599
pnpm-lock.yaml
599
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -1,16 +1,29 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
|
import { createRequire } from 'module'
|
||||||
|
import { fileURLToPath } from 'url'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import ts from 'rollup-plugin-typescript2'
|
import ts from 'rollup-plugin-typescript2'
|
||||||
import replace from '@rollup/plugin-replace'
|
import replace from '@rollup/plugin-replace'
|
||||||
import json from '@rollup/plugin-json'
|
import json from '@rollup/plugin-json'
|
||||||
|
import chalk from 'chalk'
|
||||||
|
import commonJS from '@rollup/plugin-commonjs'
|
||||||
|
import polyfillNode from 'rollup-plugin-polyfill-node'
|
||||||
|
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
||||||
|
import { terser } from 'rollup-plugin-terser'
|
||||||
|
|
||||||
if (!process.env.TARGET) {
|
if (!process.env.TARGET) {
|
||||||
throw new Error('TARGET package must be specified via --environment flag.')
|
throw new Error('TARGET package must be specified via --environment flag.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url)
|
||||||
|
const __dirname = fileURLToPath(new URL('.', import.meta.url))
|
||||||
|
|
||||||
const masterVersion = require('./package.json').version
|
const masterVersion = require('./package.json').version
|
||||||
|
const consolidatePkg = require('@vue/consolidate/package.json')
|
||||||
|
|
||||||
const packagesDir = path.resolve(__dirname, 'packages')
|
const packagesDir = path.resolve(__dirname, 'packages')
|
||||||
const packageDir = path.resolve(packagesDir, process.env.TARGET)
|
const packageDir = path.resolve(packagesDir, process.env.TARGET)
|
||||||
|
|
||||||
const resolve = p => path.resolve(packageDir, p)
|
const resolve = p => path.resolve(packageDir, p)
|
||||||
const pkg = require(resolve(`package.json`))
|
const pkg = require(resolve(`package.json`))
|
||||||
const packageOptions = pkg.buildOptions || {}
|
const packageOptions = pkg.buildOptions || {}
|
||||||
|
@ -76,7 +89,7 @@ export default packageConfigs
|
||||||
|
|
||||||
function createConfig(format, output, plugins = []) {
|
function createConfig(format, output, plugins = []) {
|
||||||
if (!output) {
|
if (!output) {
|
||||||
console.log(require('chalk').yellow(`invalid format: "${format}"`))
|
console.log(chalk.yellow(`invalid format: "${format}"`))
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,11 +166,8 @@ function createConfig(format, output, plugins = []) {
|
||||||
// requires a ton of template engines which should be ignored.
|
// requires a ton of template engines which should be ignored.
|
||||||
let cjsIgnores = []
|
let cjsIgnores = []
|
||||||
if (pkg.name === '@vue/compiler-sfc') {
|
if (pkg.name === '@vue/compiler-sfc') {
|
||||||
const consolidatePath = require.resolve('@vue/consolidate/package.json', {
|
|
||||||
paths: [packageDir]
|
|
||||||
})
|
|
||||||
cjsIgnores = [
|
cjsIgnores = [
|
||||||
...Object.keys(require(consolidatePath).devDependencies),
|
...Object.keys(consolidatePkg.devDependencies),
|
||||||
'vm',
|
'vm',
|
||||||
'crypto',
|
'crypto',
|
||||||
'react-dom/server',
|
'react-dom/server',
|
||||||
|
@ -172,16 +182,12 @@ function createConfig(format, output, plugins = []) {
|
||||||
(format === 'cjs' && Object.keys(pkg.devDependencies || {}).length) ||
|
(format === 'cjs' && Object.keys(pkg.devDependencies || {}).length) ||
|
||||||
packageOptions.enableNonBrowserBranches
|
packageOptions.enableNonBrowserBranches
|
||||||
? [
|
? [
|
||||||
// @ts-ignore
|
commonJS({
|
||||||
require('@rollup/plugin-commonjs')({
|
|
||||||
sourceMap: false,
|
sourceMap: false,
|
||||||
ignore: cjsIgnores
|
ignore: cjsIgnores
|
||||||
}),
|
}),
|
||||||
...(format === 'cjs'
|
...(format === 'cjs' ? [] : [polyfillNode()]),
|
||||||
? []
|
nodeResolve()
|
||||||
: // @ts-ignore
|
|
||||||
[require('rollup-plugin-polyfill-node')()]),
|
|
||||||
require('@rollup/plugin-node-resolve').nodeResolve()
|
|
||||||
]
|
]
|
||||||
: []
|
: []
|
||||||
|
|
||||||
|
@ -301,7 +307,6 @@ function createProductionConfig(format) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMinifiedConfig(format) {
|
function createMinifiedConfig(format) {
|
||||||
const { terser } = require('rollup-plugin-terser')
|
|
||||||
return createConfig(
|
return createConfig(
|
||||||
format,
|
format,
|
||||||
{
|
{
|
Loading…
Reference in New Issue