Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-compile more dependencies #32627

Merged
merged 13 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@types/rimraf": "3.0.0",
"@types/tar": "4.0.3",
"@types/validate-npm-package-name": "3.0.0",
"@vercel/ncc": "0.33.0",
"@vercel/ncc": "0.33.1",
"async-retry": "1.3.1",
"chalk": "2.4.2",
"commander": "2.20.0",
Expand Down
6 changes: 2 additions & 4 deletions packages/next-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@
"release": "ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register",
"prepublish": "yarn release && yarn types"
},
"dependencies": {
"devDependencies": {
"@vercel/ncc": "0.33.1",
"dotenv": "10.0.0",
"dotenv-expand": "5.1.0"
},
"devDependencies": {
"@vercel/ncc": "0.33.0"
}
}
4 changes: 3 additions & 1 deletion packages/next/build/cssnano-simple.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module.exports = require('cssnano-simple')(require('postcss'))
module.exports = require('next/dist/compiled/cssnano-simple')(
require('postcss')
)
43 changes: 24 additions & 19 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,30 +632,35 @@ export default async function getBaseWebpackConfig(
// Full list of old polyfills is accessible here:
// https://github.com/webpack/webpack/blob/2a0536cf510768111a3a6dceeb14cb79b9f59273/lib/ModuleNotFoundError.js#L13-L42
fallback: {
assert: require.resolve('assert/'),
buffer: require.resolve('buffer/'),
constants: require.resolve('constants-browserify'),
crypto: require.resolve('crypto-browserify'),
domain: require.resolve('domain-browser'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
os: require.resolve('os-browserify/browser'),
path: require.resolve('path-browserify'),
assert: require.resolve('next/dist/compiled/assert'),
buffer: require.resolve('next/dist/compiled/buffer/'),
constants: require.resolve(
'next/dist/compiled/constants-browserify'
),
crypto: require.resolve('next/dist/compiled/crypto-browserify'),
domain: require.resolve('next/dist/compiled/domain-browser'),
http: require.resolve('next/dist/compiled/stream-http'),
https: require.resolve('next/dist/compiled/https-browserify'),
os: require.resolve('next/dist/compiled/os-browserify'),
path: require.resolve('next/dist/compiled/path-browserify'),
punycode: require.resolve('punycode'),
process: require.resolve('process/browser'),
process: require.resolve('next/dist/compiled/process'),
// Handled in separate alias
querystring: require.resolve('querystring-es3'),
querystring: require.resolve('next/dist/compiled/querystring-es3'),
// TODO: investigate ncc'ing stream-browserify
stream: require.resolve('stream-browserify'),
string_decoder: require.resolve('string_decoder'),
sys: require.resolve('util/'),
timers: require.resolve('timers-browserify'),
tty: require.resolve('tty-browserify'),
string_decoder: require.resolve(
'next/dist/compiled/string_decoder'
),
sys: require.resolve('next/dist/compiled/util/'),
timers: require.resolve('next/dist/compiled/timers-browserify'),
tty: require.resolve('next/dist/compiled/tty-browserify'),
// Handled in separate alias
// url: require.resolve('url/'),
util: require.resolve('util/'),
vm: require.resolve('vm-browserify'),
zlib: require.resolve('browserify-zlib'),
events: require.resolve('events'),
util: require.resolve('next/dist/compiled/util/'),
vm: require.resolve('next/dist/compiled/vm-browserify'),
zlib: require.resolve('next/dist/compiled/browserify-zlib'),
events: require.resolve('next/dist/compiled/events/'),
},
}
: undefined),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import * as acorn from 'acorn'
import * as acorn from 'next/dist/compiled/acorn'

type ResolveContext = {
conditions: Array<string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as acorn from 'acorn'
import * as acorn from 'next/dist/compiled/acorn'
import { getRawPageExtensions } from '../../utils'

function isClientComponent(importSource: string, pageExtensions: string[]) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cssnanoSimple from 'cssnano-simple'
import cssnanoSimple from 'next/dist/compiled/cssnano-simple'
import postcssScss from 'next/dist/compiled/postcss-scss'
import postcss, { Parser } from 'postcss'
import { webpack, sources } from 'next/dist/compiled/webpack/webpack'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
FontManifest,
} from '../../../server/font-utils'
import postcss from 'postcss'
import minifier from 'cssnano-simple'
import minifier from 'next/dist/compiled/cssnano-simple'
import {
FONT_MANIFEST,
OPTIMIZED_FONT_PROVIDERS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ModuleFilenameHelpers,
sources,
} from 'next/dist/compiled/webpack/webpack'
import pLimit from 'p-limit'
import pLimit from 'next/dist/compiled/p-limit'
import { Worker } from 'jest-worker'
import { spans } from '../../profiling-plugin'

Expand Down
1 change: 1 addition & 0 deletions packages/next/compiled/@hapi/accept/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/@hapi/accept/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"@hapi/accept","main":"index.js","license":"BSD-3-Clause"}
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"acorn","main":"acorn.js","license":"MIT"}
18 changes: 18 additions & 0 deletions packages/next/compiled/assert/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
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.
7 changes: 7 additions & 0 deletions packages/next/compiled/assert/assert.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/assert/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"assert","main":"assert.js","license":"MIT"}
70 changes: 70 additions & 0 deletions packages/next/compiled/browserify-zlib/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
The MIT License (MIT)

Copyright (c) 2014-2015 Devon Govett <[email protected]>

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 project contains parts of Node.js.
Node.js is licensed for use as follows:

"""
Copyright Node.js contributors. All rights reserved.

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 license applies to parts of Node.js originating from the
https://github.com/joyent/node repository:

"""
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
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/browserify-zlib/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/browserify-zlib/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"browserify-zlib","main":"index.js","author":"Devon Govett <[email protected]>","license":"MIT"}
21 changes: 21 additions & 0 deletions packages/next/compiled/buffer/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Feross Aboukhadijeh, 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.
7 changes: 7 additions & 0 deletions packages/next/compiled/buffer/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/buffer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"buffer","main":"index.js","author":{"name":"Feross Aboukhadijeh","email":"[email protected]","url":"http://feross.org"},"license":"MIT"}
1 change: 1 addition & 0 deletions packages/next/compiled/constants-browserify/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"constants-browserify","main":"./constants.json"}
24 changes: 24 additions & 0 deletions packages/next/compiled/crypto-browserify/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
The MIT License

Copyright (c) 2013 Dominic Tarr

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/crypto-browserify/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/crypto-browserify/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"crypto-browserify","main":"index.js","author":"Dominic Tarr <[email protected]> (dominictarr.com)","license":"MIT"}
195 changes: 195 additions & 0 deletions packages/next/compiled/cssnano-simple/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/cssnano-simple/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"cssnano-simple","main":"index.js","author":"Joe Haddad <[email protected]>","license":"MIT"}
1 change: 1 addition & 0 deletions packages/next/compiled/domain-browser/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/next/compiled/domain-browser/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"domain-browser","main":"index.js","author":"2013+ Bevry Pty Ltd <[email protected]> (http://bevry.me)","license":"MIT"}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2012 Tobias Koppers
Copyright (c) 2014-2016 Douglas Christopher Wilson

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
7 changes: 7 additions & 0 deletions packages/next/compiled/etag/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/next/compiled/etag/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"etag","main":"index.js","license":"MIT"}
22 changes: 22 additions & 0 deletions packages/next/compiled/events/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT

Copyright Joyent, Inc. and other Node 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.
Loading