-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc(build): create rollup-plugins.js helper module (#13122)
- Loading branch information
1 parent
749c56a
commit 4010f8c
Showing
6 changed files
with
89 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* @license Copyright 2021 The Lighthouse Authors. All Rights Reserved. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
*/ | ||
'use strict'; | ||
|
||
/** | ||
* Rollup plugins don't export types that work with commonjs. | ||
* @template T | ||
* @param {T} module | ||
* @return {T['default']} | ||
*/ | ||
function rollupPluginTypeCoerce(module) { | ||
// @ts-expect-error | ||
return module; | ||
} | ||
|
||
const commonjs = rollupPluginTypeCoerce(require('@rollup/plugin-commonjs')); | ||
const {nodeResolve} = require('@rollup/plugin-node-resolve'); | ||
// @ts-expect-error: no published types. | ||
const shim = require('rollup-plugin-shim'); | ||
const {terser} = require('rollup-plugin-terser'); | ||
const typescript = rollupPluginTypeCoerce(require('@rollup/plugin-typescript')); | ||
|
||
module.exports = { | ||
commonjs, | ||
nodeResolve, | ||
shim, | ||
terser, | ||
typescript, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1212,6 +1212,19 @@ | |
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" | ||
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= | ||
|
||
"@rollup/plugin-commonjs@^20.0.0": | ||
version "20.0.0" | ||
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-20.0.0.tgz#3246872dcbcb18a54aaa6277a8c7d7f1b155b745" | ||
integrity sha512-5K0g5W2Ol8hAcTHqcTBHiA7M58tfmYi1o9KxeJuuRNpGaTa5iLjcyemBitCBcKXaHamOBBEH2dGom6v6Unmqjg== | ||
dependencies: | ||
"@rollup/pluginutils" "^3.1.0" | ||
commondir "^1.0.1" | ||
estree-walker "^2.0.1" | ||
glob "^7.1.6" | ||
is-reference "^1.2.1" | ||
magic-string "^0.25.7" | ||
resolve "^1.17.0" | ||
|
||
"@rollup/plugin-node-resolve@^13.0.4": | ||
version "13.0.4" | ||
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.4.tgz#b10222f4145a019740acb7738402130d848660c0" | ||
|
@@ -2944,6 +2957,11 @@ commander@~2.17.1: | |
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" | ||
integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== | ||
|
||
commondir@^1.0.1: | ||
version "1.0.1" | ||
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" | ||
integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= | ||
|
||
compare-func@^1.3.1: | ||
version "1.3.2" | ||
resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" | ||
|
@@ -4082,6 +4100,11 @@ estree-walker@^1.0.1: | |
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" | ||
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== | ||
|
||
estree-walker@^2.0.1: | ||
version "2.0.2" | ||
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" | ||
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== | ||
|
||
esutils@^2.0.2: | ||
version "2.0.2" | ||
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" | ||
|
@@ -4685,6 +4708,18 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, gl | |
once "^1.3.0" | ||
path-is-absolute "^1.0.0" | ||
|
||
glob@^7.1.6: | ||
version "7.2.0" | ||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" | ||
integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== | ||
dependencies: | ||
fs.realpath "^1.0.0" | ||
inflight "^1.0.4" | ||
inherits "2" | ||
minimatch "^3.0.4" | ||
once "^1.3.0" | ||
path-is-absolute "^1.0.0" | ||
|
||
global-dirs@^2.0.1: | ||
version "2.0.1" | ||
resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-2.0.1.tgz#acdf3bb6685bcd55cb35e8a052266569e9469201" | ||
|
@@ -5410,7 +5445,7 @@ is-potential-custom-element-name@^1.0.1: | |
resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" | ||
integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== | ||
|
||
is-reference@^1.1.2: | ||
is-reference@^1.2.1: | ||
version "1.2.1" | ||
resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" | ||
integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== | ||
|
@@ -6559,7 +6594,7 @@ [email protected]: | |
dependencies: | ||
sourcemap-codec "^1.4.1" | ||
|
||
magic-string@^0.25.2: | ||
magic-string@^0.25.7: | ||
version "0.25.7" | ||
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" | ||
integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== | ||
|
@@ -7938,7 +7973,7 @@ resolve-url@^0.2.1: | |
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" | ||
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= | ||
|
||
resolve@^1.1.4, resolve@^1.1.5, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.4.0: | ||
resolve@^1.1.4, resolve@^1.1.5, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.4.0: | ||
version "1.20.0" | ||
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" | ||
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== | ||
|
@@ -7997,17 +8032,6 @@ robots-parser@^2.0.1: | |
resolved "https://registry.npmjs.org/robots-parser/-/robots-parser-2.1.0.tgz#d16b78ce34e861ab6afbbf0aac65974dbe01566e" | ||
integrity sha512-k07MeDS1Tl1zjoYs5bHfUbgQ0MfaeTOepDcjZFxdYXd84p6IeLDQyUwlMk2AZ9c2yExA30I3ayWhmqz9tg0DzQ== | ||
|
||
rollup-plugin-commonjs@^10.1.0: | ||
version "10.1.0" | ||
resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-10.1.0.tgz#417af3b54503878e084d127adf4d1caf8beb86fb" | ||
integrity sha512-jlXbjZSQg8EIeAAvepNwhJj++qJWNJw1Cl0YnOqKtP5Djx+fFGkp3WRh+W0ASCaFG5w1jhmzDxgu3SJuVxPF4Q== | ||
dependencies: | ||
estree-walker "^0.6.1" | ||
is-reference "^1.1.2" | ||
magic-string "^0.25.2" | ||
resolve "^1.11.0" | ||
rollup-pluginutils "^2.8.1" | ||
|
||
rollup-plugin-node-resolve@^5.2.0: | ||
version "5.2.0" | ||
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.2.0.tgz#730f93d10ed202473b1fb54a5997a7db8c6d8523" | ||
|