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

chore: compile css-loader #21357

Merged
merged 4 commits into from Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -24,7 +24,7 @@ export function getGlobalCssLoader(

// Resolve CSS `@import`s and `url()`s
loaders.push({
loader: require.resolve('css-loader'),
loader: require.resolve('next/dist/compiled/css-loader'),
options: {
importLoaders: 1 + preProcessors.length,
sourceMap: true,
Expand Down
Expand Up @@ -25,7 +25,7 @@ export function getCssModuleLoader(

// Resolve CSS `@import`s and `url()`s
loaders.push({
loader: require.resolve('css-loader'),
loader: require.resolve('next/dist/compiled/css-loader'),
options: {
importLoaders: 1 + preProcessors.length,
sourceMap: true,
Expand Down
20 changes: 20 additions & 0 deletions packages/next/compiled/css-loader/LICENSE
@@ -0,0 +1,20 @@
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.
1 change: 1 addition & 0 deletions packages/next/compiled/css-loader/api.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/css-loader/cjs.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/next/compiled/css-loader/getUrl.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/css-loader/package.json
@@ -0,0 +1 @@
{"name":"css-loader","main":"cjs.js","author":"Tobias Koppers @sokra","license":"MIT"}
2 changes: 1 addition & 1 deletion packages/next/package.json
Expand Up @@ -75,7 +75,6 @@
"chalk": "2.4.2",
"chokidar": "3.5.1",
"crypto-browserify": "3.12.0",
"css-loader": "4.3.0",
"cssnano-simple": "1.2.1",
"etag": "1.8.1",
"find-cache-dir": "3.3.1",
Expand Down Expand Up @@ -187,6 +186,7 @@
"conf": "5.0.0",
"content-type": "1.0.4",
"cookie": "0.4.1",
"css-loader": "4.3.0",
"debug": "4.1.1",
"devalue": "2.0.1",
"escape-string-regexp": "2.0.0",
Expand Down
16 changes: 16 additions & 0 deletions packages/next/taskfile.js
Expand Up @@ -203,6 +203,21 @@ export async function ncc_cookie(task, opts) {
.target('compiled/cookie')
}
// 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'
export async function ncc_debug(task, opts) {
await task
Expand Down Expand Up @@ -669,6 +684,7 @@ export async function ncc(task) {
'ncc_conf',
'ncc_content_type',
'ncc_cookie',
'ncc_css_loader',
'ncc_debug',
'ncc_devalue',
'ncc_escape_string_regexp',
Expand Down