Unverified Commit ec69752d authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

[backport] Split code-frame into separate compiled package (#84174) (#84238)

backports #84174
parent 40f1d781
/* eslint-disable import/no-extraneous-dependencies */
module.exports = require('@babel/code-frame')
...@@ -4,10 +4,6 @@ function types() { ...@@ -4,10 +4,6 @@ function types() {
return require('@babel/types') return require('@babel/types')
} }
function codeFrame() {
return require('@babel/code-frame')
}
function core() { function core() {
return require('@babel/core') return require('@babel/core')
} }
...@@ -110,7 +106,6 @@ function presetTypescript() { ...@@ -110,7 +106,6 @@ function presetTypescript() {
module.exports = { module.exports = {
types, types,
codeFrame,
core, core,
coreLibConfig, coreLibConfig,
coreLibNormalizeFile, coreLibNormalizeFile,
......
module.exports = require('./bundle').codeFrame() module.exports = require('next/dist/compiled/babel-code-frame')
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This diff is collapsed.
{"name":"@babel/code-frame","main":"index.js","author":"The Babel Team (https://babel.dev/team)","license":"MIT"}
This source diff could not be displayed because it is too large. You can view the blob instead.
module.exports = require('./bundle').codeFrame() module.exports = require('next/dist/compiled/babel-code-frame')
...@@ -1068,6 +1068,9 @@ const babelCorePackages = { ...@@ -1068,6 +1068,9 @@ const babelCorePackages = {
externals['next/dist/compiled/babel/code-frame'] = externals['next/dist/compiled/babel/code-frame'] =
'next/dist/compiled/babel/code-frame' 'next/dist/compiled/babel/code-frame'
externals['next/dist/compiled/babel-code-frame'] =
'next/dist/compiled/babel-code-frame'
Object.assign(externals, babelCorePackages) Object.assign(externals, babelCorePackages)
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
...@@ -1089,6 +1092,22 @@ export async function ncc_babel_bundle(task, opts) { ...@@ -1089,6 +1092,22 @@ export async function ncc_babel_bundle(task, opts) {
.target('src/compiled/babel') .target('src/compiled/babel')
} }
// eslint-disable-next-line camelcase
export async function ncc_babel_code_frame(task, opts) {
const bundleExternals = {
...externals,
'next/dist/compiled/babel-packages': 'next/dist/compiled/babel-packages',
}
await task
.source('src/bundles/babel-code-frame/index.js')
.ncc({
packageName: '@babel/code-frame',
bundleName: 'babel-code-frame',
externals: bundleExternals,
})
.target('src/compiled/babel-code-frame')
}
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
export async function ncc_babel_bundle_packages(task, opts) { export async function ncc_babel_bundle_packages(task, opts) {
const eslintParseFile = join( const eslintParseFile = join(
...@@ -2326,6 +2345,7 @@ export async function ncc(task, opts) { ...@@ -2326,6 +2345,7 @@ export async function ncc(task, opts) {
'ncc_tty_browserify', 'ncc_tty_browserify',
'ncc_vm_browserify', 'ncc_vm_browserify',
'ncc_babel_bundle', 'ncc_babel_bundle',
'ncc_babel_code_frame',
'ncc_bytes', 'ncc_bytes',
'ncc_ci_info', 'ncc_ci_info',
'ncc_cli_select', 'ncc_cli_select',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment