mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 20:51:07 +08:00
replace file-loader and url-loader with asset modules in manager webpack5 config
This commit is contained in:
parent
1dff968be4
commit
cf09866578
@ -59,7 +59,6 @@
|
||||
"css-loader": "^5.0.1",
|
||||
"dotenv-webpack": "^7.0.0",
|
||||
"express": "^4.17.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"file-system-cache": "^1.0.5",
|
||||
"find-up": "^5.0.0",
|
||||
"fs-extra": "^9.0.1",
|
||||
@ -72,7 +71,6 @@
|
||||
"telejson": "^5.3.2",
|
||||
"terser-webpack-plugin": "^5.0.3",
|
||||
"ts-dedent": "^2.0.0",
|
||||
"url-loader": "^4.1.1",
|
||||
"util-deprecate": "^1.0.2",
|
||||
"webpack": "^5.9.0",
|
||||
"webpack-dev-middleware": "^4.1.0",
|
||||
|
@ -138,19 +138,23 @@ export async function managerWebpack(
|
||||
},
|
||||
{
|
||||
test: /\.(svg|ico|jpg|jpeg|png|apng|gif|eot|otf|webp|ttf|woff|woff2|cur|ani|pdf)(\?.*)?$/,
|
||||
loader: require.resolve('file-loader'),
|
||||
options: {
|
||||
name: isProd
|
||||
type: 'asset/resource',
|
||||
generator: {
|
||||
filename: isProd
|
||||
? 'static/media/[name].[contenthash:8][ext]'
|
||||
: 'static/media/[path][name][ext]',
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|wav|mp3|m4a|aac|oga)(\?.*)?$/,
|
||||
loader: require.resolve('url-loader'),
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: isProd
|
||||
type: 'asset',
|
||||
parser: {
|
||||
dataUrlCondition: {
|
||||
maxSize: 10000,
|
||||
},
|
||||
},
|
||||
generator: {
|
||||
filename: isProd
|
||||
? 'static/media/[name].[contenthash:8][ext]'
|
||||
: 'static/media/[path][name][ext]',
|
||||
},
|
||||
|
@ -8414,7 +8414,6 @@ __metadata:
|
||||
css-loader: ^5.0.1
|
||||
dotenv-webpack: ^7.0.0
|
||||
express: ^4.17.1
|
||||
file-loader: ^6.2.0
|
||||
file-system-cache: ^1.0.5
|
||||
find-up: ^5.0.0
|
||||
fs-extra: ^9.0.1
|
||||
@ -8427,7 +8426,6 @@ __metadata:
|
||||
telejson: ^5.3.2
|
||||
terser-webpack-plugin: ^5.0.3
|
||||
ts-dedent: ^2.0.0
|
||||
url-loader: ^4.1.1
|
||||
util-deprecate: ^1.0.2
|
||||
webpack: ^5.9.0
|
||||
webpack-dev-middleware: ^4.1.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user