Skip to content

Commit

Permalink
chore: compile resolve-url-loader (#21351)
Browse files Browse the repository at this point in the history
Closes #21166
  • Loading branch information
Timer committed Jan 19, 2021
1 parent 56b149f commit ab158c0
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/next/build/webpack/config/blocks/css/index.ts
Expand Up @@ -53,7 +53,7 @@ export const css = curry(async function css(
// To fix this, we use `resolve-url-loader` to rewrite the CSS
// imports to real file paths.
{
loader: require.resolve('resolve-url-loader'),
loader: require.resolve('next/dist/compiled/resolve-url-loader'),
options: {
// Source maps are not required here, but we may as well emit
// them.
Expand Down
1 change: 1 addition & 0 deletions packages/next/compiled/resolve-url-loader/engine/fail.js

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

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/resolve-url-loader/engine/rework.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/resolve-url-loader/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/resolve-url-loader/package.json
@@ -0,0 +1 @@
{"name":"resolve-url-loader","main":"index.js","author":"bholloway","license":"MIT"}
2 changes: 1 addition & 1 deletion packages/next/package.json
Expand Up @@ -93,7 +93,6 @@
"raw-body": "2.4.1",
"react-is": "16.13.1",
"react-refresh": "0.8.3",
"resolve-url-loader": "3.1.2",
"stream-browserify": "3.0.0",
"style-loader": "1.2.1",
"styled-jsx": "3.3.2",
Expand Down Expand Up @@ -216,6 +215,7 @@
"postcss-preset-env": "6.7.0",
"postcss-scss": "3.0.4",
"recast": "0.18.5",
"resolve-url-loader": "3.1.2",
"sass-loader": "10.0.5",
"schema-utils": "2.7.1",
"semver": "7.3.2",
Expand Down
11 changes: 11 additions & 0 deletions packages/next/taskfile.js
Expand Up @@ -433,6 +433,16 @@ export async function ncc_recast(task, opts) {
.target('compiled/recast')
}
// eslint-disable-next-line camelcase
externals['resolve-url-loader'] = 'next/dist/compiled/resolve-url-loader'
export async function ncc_resolve_url_loader(task, opts) {
await task
.source(
opts.src || relative(__dirname, require.resolve('resolve-url-loader'))
)
.ncc({ packageName: 'resolve-url-loader', externals })
.target('compiled/resolve-url-loader')
}
// eslint-disable-next-line camelcase
externals['sass-loader'] = 'next/dist/compiled/sass-loader'
export async function ncc_sass_loader(task, opts) {
await task
Expand Down Expand Up @@ -686,6 +696,7 @@ export async function ncc(task) {
'ncc_postcss_preset_env',
'ncc_postcss_scss',
'ncc_recast',
'ncc_resolve_url_loader',
'ncc_sass_loader',
'ncc_schema_utils',
'ncc_schema_utils3',
Expand Down

0 comments on commit ab158c0

Please sign in to comment.