Skip to content

Commit

Permalink
file-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored and Timer committed Mar 30, 2020
1 parent c855a38 commit 8dad5ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/next/build/webpack/config/blocks/css/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export const css = curry(async function css(
use: {
// `file-loader` always emits a URL reference, where `url-loader`
// might inline the asset as a data URI
loader: require.resolve('file-loader'),
loader: require.resolve('next/dist/compiled/file-loader'),
options: {
// Hash the file for immutable cacheability
name: 'static/media/[name].[hash].[ext]',
Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"browserslist": "4.8.3",
"css-loader": "3.3.0",
"cssnano-simple": "1.0.0",
"file-loader": "4.2.0",
"fork-ts-checker-webpack-plugin": "3.1.1",
"ignore-loader": "0.1.2",
"jest-worker": "24.9.0",
Expand Down Expand Up @@ -167,6 +166,7 @@
"dotenv-expand": "5.1.0",
"escape-string-regexp": "2.0.0",
"etag": "1.8.1",
"file-loader": "4.2.0",
"finally-polyfill": "0.1.0",
"find-up": "4.0.0",
"fresh": "0.5.2",
Expand Down
9 changes: 9 additions & 0 deletions packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ export async function ncc_etag(task, opts) {
.target('dist/compiled/etag')
}
// eslint-disable-next-line camelcase
externals['file-loader'] = 'next/dist/compiled/file-loader'
export async function ncc_file_loader(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('file-loader')))
.ncc({ packageName: 'file-loader', externals })
.target('dist/compiled/file-loader')
}
// eslint-disable-next-line camelcase
externals['find-up'] = 'next/dist/compiled/find-up'
export async function ncc_find_up(task, opts) {
await task
Expand Down Expand Up @@ -475,6 +483,7 @@ export async function precompile(task) {
'ncc_dotenv_expand',
'ncc_escape_string_regexp',
'ncc_etag',
'ncc_file_loader',
'ncc_find_up',
'ncc_fresh',
'ncc_gzip_size',
Expand Down

0 comments on commit 8dad5ab

Please sign in to comment.