Commit 8dad5abd authored by Guy Bedford's avatar Guy Bedford Committed by Joe Haddad

file-loader

parent c855a382
...@@ -283,7 +283,7 @@ export const css = curry(async function css( ...@@ -283,7 +283,7 @@ export const css = curry(async function css(
use: { use: {
// `file-loader` always emits a URL reference, where `url-loader` // `file-loader` always emits a URL reference, where `url-loader`
// might inline the asset as a data URI // might inline the asset as a data URI
loader: require.resolve('file-loader'), loader: require.resolve('next/dist/compiled/file-loader'),
options: { options: {
// Hash the file for immutable cacheability // Hash the file for immutable cacheability
name: 'static/media/[name].[hash].[ext]', name: 'static/media/[name].[hash].[ext]',
......
...@@ -81,7 +81,6 @@ ...@@ -81,7 +81,6 @@
"browserslist": "4.8.3", "browserslist": "4.8.3",
"css-loader": "3.3.0", "css-loader": "3.3.0",
"cssnano-simple": "1.0.0", "cssnano-simple": "1.0.0",
"file-loader": "4.2.0",
"fork-ts-checker-webpack-plugin": "3.1.1", "fork-ts-checker-webpack-plugin": "3.1.1",
"ignore-loader": "0.1.2", "ignore-loader": "0.1.2",
"jest-worker": "24.9.0", "jest-worker": "24.9.0",
...@@ -167,6 +166,7 @@ ...@@ -167,6 +166,7 @@
"dotenv-expand": "5.1.0", "dotenv-expand": "5.1.0",
"escape-string-regexp": "2.0.0", "escape-string-regexp": "2.0.0",
"etag": "1.8.1", "etag": "1.8.1",
"file-loader": "4.2.0",
"finally-polyfill": "0.1.0", "finally-polyfill": "0.1.0",
"find-up": "4.0.0", "find-up": "4.0.0",
"fresh": "0.5.2", "fresh": "0.5.2",
......
...@@ -214,6 +214,14 @@ export async function ncc_etag(task, opts) { ...@@ -214,6 +214,14 @@ export async function ncc_etag(task, opts) {
.target('dist/compiled/etag') .target('dist/compiled/etag')
} }
// eslint-disable-next-line camelcase // 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' externals['find-up'] = 'next/dist/compiled/find-up'
export async function ncc_find_up(task, opts) { export async function ncc_find_up(task, opts) {
await task await task
...@@ -475,6 +483,7 @@ export async function precompile(task) { ...@@ -475,6 +483,7 @@ export async function precompile(task) {
'ncc_dotenv_expand', 'ncc_dotenv_expand',
'ncc_escape_string_regexp', 'ncc_escape_string_regexp',
'ncc_etag', 'ncc_etag',
'ncc_file_loader',
'ncc_find_up', 'ncc_find_up',
'ncc_fresh', 'ncc_fresh',
'ncc_gzip_size', 'ncc_gzip_size',
......
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