Skip to content

Commit

Permalink
Compile path-to-regexp via ncc (#68465)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Aug 4, 2024
1 parent 2d7995f commit 89a72a0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
21 changes: 21 additions & 0 deletions packages/next/src/compiled/path-to-regexp/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Blake Embrey ([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.
1 change: 1 addition & 0 deletions packages/next/src/compiled/path-to-regexp/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/src/compiled/path-to-regexp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"path-to-regexp","main":"index.js","license":"MIT"}
20 changes: 6 additions & 14 deletions packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2127,15 +2127,11 @@ export async function ncc_ws(task, opts) {
}

externals['path-to-regexp'] = 'next/dist/compiled/path-to-regexp'
export async function path_to_regexp(task, opts) {
export async function ncc_path_to_regexp(task, opts) {
await task
.source(
join(
dirname(relative(__dirname, require.resolve('path-to-regexp'))),
'*.{js,map}'
)
)
.target('dist/compiled/path-to-regexp')
.source(relative(__dirname, require.resolve('path-to-regexp')))
.ncc({ packageName: 'path-to-regexp', externals })
.target('src/compiled/path-to-regexp')
}

// eslint-disable-next-line camelcase
Expand Down Expand Up @@ -2169,12 +2165,7 @@ export async function ncc_https_proxy_agent(task, opts) {

export async function precompile(task, opts) {
await task.parallel(
[
'browser_polyfills',
'path_to_regexp',
'copy_ncced',
'copy_styled_jsx_assets',
],
['browser_polyfills', 'copy_ncced', 'copy_styled_jsx_assets'],
opts
)
}
Expand Down Expand Up @@ -2264,6 +2255,7 @@ export async function ncc(task, opts) {
'ncc_native_url',
'ncc_neo_async',
'ncc_ora',
'ncc_path_to_regexp',
'ncc_postcss_safe_parser',
'ncc_postcss_flexbugs_fixes',
'ncc_postcss_preset_env',
Expand Down

0 comments on commit 89a72a0

Please sign in to comment.