Unverified Commit 47ec6771 authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

chore: compile css-loader (#21357)

This PR compiles `css-loader` to resolve a peer dep warning.
parent 55b8502d
...@@ -24,7 +24,7 @@ export function getGlobalCssLoader( ...@@ -24,7 +24,7 @@ export function getGlobalCssLoader(
// Resolve CSS `@import`s and `url()`s // Resolve CSS `@import`s and `url()`s
loaders.push({ loaders.push({
loader: require.resolve('css-loader'), loader: require.resolve('next/dist/compiled/css-loader'),
options: { options: {
importLoaders: 1 + preProcessors.length, importLoaders: 1 + preProcessors.length,
sourceMap: true, sourceMap: true,
......
...@@ -25,7 +25,7 @@ export function getCssModuleLoader( ...@@ -25,7 +25,7 @@ export function getCssModuleLoader(
// Resolve CSS `@import`s and `url()`s // Resolve CSS `@import`s and `url()`s
loaders.push({ loaders.push({
loader: require.resolve('css-loader'), loader: require.resolve('next/dist/compiled/css-loader'),
options: { options: {
importLoaders: 1 + preProcessors.length, importLoaders: 1 + preProcessors.length,
sourceMap: true, sourceMap: true,
......
Copyright JS Foundation 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.
module.exports=function(){"use strict";var n={762:function(n){n.exports=function(n){var t=[];t.toString=function toString(){return this.map(function(t){var r=cssWithMappingToString(t,n);if(t[2]){return"@media ".concat(t[2]," {").concat(r,"}")}return r}).join("")};t.i=function(n,r,o){if(typeof n==="string"){n=[[null,n,""]]}var e={};if(o){for(var a=0;a<this.length;a++){var c=this[a][0];if(c!=null){e[c]=true}}}for(var i=0;i<n.length;i++){var u=[].concat(n[i]);if(o&&e[u[0]]){continue}if(r){if(!u[2]){u[2]=r}else{u[2]="".concat(r," and ").concat(u[2])}}t.push(u)}};return t};function cssWithMappingToString(n,t){var r=n[1]||"";var o=n[3];if(!o){return r}if(t&&typeof btoa==="function"){var e=toComment(o);var a=o.sources.map(function(n){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(n," */")});return[r].concat(a).concat([e]).join("\n")}return[r].join("\n")}function toComment(n){var t=btoa(unescape(encodeURIComponent(JSON.stringify(n))));var r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(r," */")}}};var t={};function __nccwpck_require__(r){if(t[r]){return t[r].exports}var o=t[r]={exports:{}};var e=true;try{n[r](o,o.exports,__nccwpck_require__);e=false}finally{if(e)delete t[r]}return o.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(762)}();
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
module.exports=function(){"use strict";var e={91:function(e){e.exports=function(e,r){if(!r){r={}}e=e&&e.__esModule?e.default:e;if(typeof e!=="string"){return e}if(/^['"].*['"]$/.test(e)){e=e.slice(1,-1)}if(r.hash){e+=r.hash}if(/["'() \t\n]/.test(e)||r.needQuotes){return'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"')}return e}}};var r={};function __nccwpck_require__(t){if(r[t]){return r[t].exports}var _=r[t]={exports:{}};var n=true;try{e[t](_,_.exports,__nccwpck_require__);n=false}finally{if(n)delete r[t]}return _.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(91)}();
\ No newline at end of file
{"name":"css-loader","main":"cjs.js","author":"Tobias Koppers @sokra","license":"MIT"}
...@@ -75,7 +75,6 @@ ...@@ -75,7 +75,6 @@
"chalk": "2.4.2", "chalk": "2.4.2",
"chokidar": "3.5.1", "chokidar": "3.5.1",
"crypto-browserify": "3.12.0", "crypto-browserify": "3.12.0",
"css-loader": "4.3.0",
"cssnano-simple": "1.2.1", "cssnano-simple": "1.2.1",
"etag": "1.8.1", "etag": "1.8.1",
"find-cache-dir": "3.3.1", "find-cache-dir": "3.3.1",
...@@ -187,6 +186,7 @@ ...@@ -187,6 +186,7 @@
"conf": "5.0.0", "conf": "5.0.0",
"content-type": "1.0.4", "content-type": "1.0.4",
"cookie": "0.4.1", "cookie": "0.4.1",
"css-loader": "4.3.0",
"debug": "4.1.1", "debug": "4.1.1",
"devalue": "2.0.1", "devalue": "2.0.1",
"escape-string-regexp": "2.0.0", "escape-string-regexp": "2.0.0",
......
...@@ -203,6 +203,21 @@ export async function ncc_cookie(task, opts) { ...@@ -203,6 +203,21 @@ export async function ncc_cookie(task, opts) {
.target('compiled/cookie') .target('compiled/cookie')
} }
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
externals['css-loader'] = 'next/dist/compiled/css-loader'
export async function ncc_css_loader(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('css-loader')))
.ncc({
packageName: 'css-loader',
externals: {
...externals,
'schema-utils': 'next/dist/compiled/schema-utils',
},
target: 'es5',
})
.target('compiled/css-loader')
}
// eslint-disable-next-line camelcase
externals['debug'] = 'next/dist/compiled/debug' externals['debug'] = 'next/dist/compiled/debug'
export async function ncc_debug(task, opts) { export async function ncc_debug(task, opts) {
await task await task
...@@ -669,6 +684,7 @@ export async function ncc(task) { ...@@ -669,6 +684,7 @@ export async function ncc(task) {
'ncc_conf', 'ncc_conf',
'ncc_content_type', 'ncc_content_type',
'ncc_cookie', 'ncc_cookie',
'ncc_css_loader',
'ncc_debug', 'ncc_debug',
'ncc_devalue', 'ncc_devalue',
'ncc_escape_string_regexp', 'ncc_escape_string_regexp',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment