Skip to content

Commit

Permalink
keep pre-compiled acorn as external
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jan 27, 2022
1 parent 7f45560 commit 0d271b0
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 5,586 deletions.
6 changes: 3 additions & 3 deletions packages/next/compiled/@vercel/nft/index.js

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions packages/next/compiled/acorn/LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (C) 2012-2020 by various contributors (see AUTHORS)

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.
1 change: 1 addition & 0 deletions packages/next/compiled/acorn/acorn.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/acorn/package.json
@@ -0,0 +1 @@
{"name":"acorn","main":"acorn.js","license":"MIT"}
2 changes: 1 addition & 1 deletion packages/next/compiled/terser/bundle.min.js

Large diffs are not rendered by default.

5,594 changes: 12 additions & 5,582 deletions packages/next/compiled/webpack/bundle5.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions packages/next/taskfile.js
Expand Up @@ -135,6 +135,15 @@ export async function ncc_node_fetch(task, opts) {
.target('compiled/node-fetch')
}

// eslint-disable-next-line camelcase
externals['acorn'] = 'next/dist/compiled/acorn'
export async function ncc_acorn(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('acorn')))
.ncc({ packageName: 'acorn', externals })
.target('compiled/acorn')
}

// eslint-disable-next-line camelcase
export async function ncc_next__react_dev_overlay(task, opts) {
const overlayExternals = {
Expand Down Expand Up @@ -1578,6 +1587,7 @@ export async function ncc(task, opts) {
'ncc_get_orientation',
'ncc_hapi_accept',
'ncc_node_fetch',
'ncc_acorn',
'ncc_amphtml_validator',
'ncc_arg',
'ncc_async_retry',
Expand Down
4 changes: 4 additions & 0 deletions packages/next/types/misc.d.ts
Expand Up @@ -76,6 +76,10 @@ declare module 'next/dist/compiled/get-orientation' {
export = m
}

declare module 'next/dist/compiled/acorn' {
import m from 'acorn'
export = m
}
declare module 'next/dist/compiled/amphtml-validator' {
import m from 'amphtml-validator'
export = m
Expand Down

0 comments on commit 0d271b0

Please sign in to comment.