Skip to content

Commit

Permalink
Merge branch 'img-optimizer/update-relative-handling' of github.com:i…
Browse files Browse the repository at this point in the history
…jjk/next.js into img-optimizer/update-relative-handling
  • Loading branch information
ijjk committed Oct 19, 2020
2 parents bcb0543 + e6bef1b commit 106ddc6
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 35 deletions.
Expand Up @@ -40,8 +40,7 @@ export function getGlobalCssLoader(
loaders.push({
loader: require.resolve('next/dist/compiled/postcss-loader'),
options: {
ident: '__nextjs_postcss',
plugins: postCssPlugins,
postcssOptions: { plugins: postCssPlugins, config: false },
sourceMap: true,
},
})
Expand Down
Expand Up @@ -56,8 +56,7 @@ export function getCssModuleLoader(
loaders.push({
loader: require.resolve('next/dist/compiled/postcss-loader'),
options: {
ident: '__nextjs_postcss',
plugins: postCssPlugins,
postcssOptions: { plugins: postCssPlugins, config: false },
sourceMap: true,
},
})
Expand Down
Expand Up @@ -12,9 +12,9 @@ export async function __overrideCssConfiguration(
if (
rule.options &&
typeof rule.options === 'object' &&
rule.options['ident'] === '__nextjs_postcss'
typeof rule.options.postcssOptions === 'object'
) {
rule.options.plugins = postCssPlugins
rule.options.postcssOptions.plugins = postCssPlugins
} else if (Array.isArray(rule.oneOf)) {
rule.oneOf.forEach(patch)
} else if (Array.isArray(rule.use)) {
Expand Down
34 changes: 17 additions & 17 deletions packages/next/compiled/postcss-loader/LICENSE
@@ -1,20 +1,20 @@
License (MIT)
Copyright JS Foundation and other contributors

Copyright 2017 Andrey Sitnik <andrey@sitnik.ru>
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:

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 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.
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/postcss-loader/cjs.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/next/compiled/postcss-loader/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/next/compiled/postcss-loader/package.json
@@ -1 +1 @@
{"name":"postcss-loader","main":"index.js","author":"Andrey Sitnik <andrey@sitnik.ru>","license":"MIT"}
{"name":"postcss-loader","main":"cjs.js","author":"Andrey Sitnik <andrey@sitnik.ru>","license":"MIT"}
2 changes: 1 addition & 1 deletion packages/next/package.json
Expand Up @@ -198,7 +198,7 @@
"ora": "4.0.4",
"path-to-regexp": "6.1.0",
"postcss-flexbugs-fixes": "4.2.1",
"postcss-loader": "3.0.0",
"postcss-loader": "4.0.3",
"postcss-preset-env": "6.7.0",
"raw-body": "2.4.1",
"recast": "0.18.5",
Expand Down
14 changes: 6 additions & 8 deletions test/acceptance/ReactRefreshLogBox.test.js
Expand Up @@ -812,13 +812,11 @@ test('css syntax errors', async () => {
await session.patch('index.module.css', `.button {`)
expect(await session.hasRedbox(true)).toBe(true)
const source = await session.getRedboxSource()
expect(source).toMatchInlineSnapshot(`
"./index.module.css:1:1
Syntax error: Unclosed block
> 1 | .button {
| ^"
`)
expect(source).toMatch('./index.module.css:1:1')
expect(source).toMatch('Syntax error: ')
expect(source).toMatch('Unclosed block')
expect(source).toMatch('> 1 | .button {')
expect(source).toMatch(' | ^')

// Not local error
await session.patch('index.module.css', `button {}`)
Expand All @@ -829,7 +827,7 @@ test('css syntax errors', async () => {
Syntax error: Selector \\"button\\" is not pure (pure selectors must contain at least one local class or id)
> 1 | button {}
| ^"
| ^"
`)

await cleanup()
Expand Down
35 changes: 34 additions & 1 deletion yarn.lock
Expand Up @@ -5766,6 +5766,17 @@ cosmiconfig@^6.0.0:
path-type "^4.0.0"
yaml "^1.7.2"

cosmiconfig@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3"
integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==
dependencies:
"@types/parse-json" "^4.0.0"
import-fresh "^3.2.1"
parse-json "^5.0.0"
path-type "^4.0.0"
yaml "^1.10.0"

coveralls@3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.3.tgz#83b1c64aea1c6afa69beaf50b55ac1bc4d13e2b8"
Expand Down Expand Up @@ -8659,7 +8670,7 @@ import-fresh@^2.0.0:
caller-path "^2.0.0"
resolve-from "^3.0.0"

import-fresh@^3.0.0, import-fresh@^3.1.0:
import-fresh@^3.0.0, import-fresh@^3.1.0, import-fresh@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66"
dependencies:
Expand Down Expand Up @@ -10288,6 +10299,11 @@ klona@^2.0.3:
resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.3.tgz#98274552c513583ad7a01456a789a2a0b4a2a538"
integrity sha512-CgPOT3ZadDpXxKcfV56lEQ9OQSZ42Mk26gnozI+uN/k39vzD8toUhRQoqsX0m9Q3eMPEfsLWmtyUpK/yqST4yg==

klona@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.4.tgz#7bb1e3affb0cb8624547ef7e8f6708ea2e39dfc0"
integrity sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA==

ky-universal@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/ky-universal/-/ky-universal-0.6.0.tgz#a91c265c80c38f750e65bbc6d72df16f5b58691f"
Expand Down Expand Up @@ -12948,6 +12964,17 @@ postcss-loader@3.0.0:
postcss-load-config "^2.0.0"
schema-utils "^1.0.0"

postcss-loader@4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-4.0.3.tgz#337f51bbdfb02269fb42f7db9fc7f0a93c1b2e3f"
integrity sha512-jHboC/AOnJLPu8/974hODCJ/rNAa2YhhJOclUeuRlAmFpKmEcBY6az8y1ejHyYc2LThzPl8qPRekh2Yz3CiRKA==
dependencies:
cosmiconfig "^7.0.0"
klona "^2.0.4"
loader-utils "^2.0.0"
schema-utils "^2.7.1"
semver "^7.3.2"

postcss-logical@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/postcss-logical/-/postcss-logical-3.0.0.tgz#2495d0f8b82e9f262725f75f9401b34e7b45d5b5"
Expand Down Expand Up @@ -16177,6 +16204,7 @@ text-table@0.2.0, text-table@^0.2.0:
thread-loader@2.1.3:
version "2.1.3"
resolved "https://registry.yarnpkg.com/thread-loader/-/thread-loader-2.1.3.tgz#cbd2c139fc2b2de6e9d28f62286ab770c1acbdda"
integrity sha512-wNrVKH2Lcf8ZrWxDF/khdlLlsTMczdcwPA9VEK4c2exlEPynYWxi9op3nPTo5lAnDIkE0rQEB3VBP+4Zncc9Hg==
dependencies:
loader-runner "^2.3.1"
loader-utils "^1.1.0"
Expand Down Expand Up @@ -17270,6 +17298,11 @@ yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"

yaml@^1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e"
integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==

yaml@^1.7.2:
version "1.9.2"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.9.2.tgz#f0cfa865f003ab707663e4f04b3956957ea564ed"
Expand Down

0 comments on commit 106ddc6

Please sign in to comment.