Я получал это предупреждение на каждом маршруте, например:
Multiple assets emit different content to the same filename
static/css/static/development/pages/_app.js.chunk.css.map
Multiple assets emit different content to the same filename
static/css/static/development/pages/index.js.chunk.css.map
Multiple assets emit different content to the same filename
static/css/static/development/pages/login.js.chunk.css.map
и вот мой следующий конфиг:
const withPlugins = require('next-compose-plugins');
const withCss = require('@zeit/next-css');
const withSass = require('@zeit/next-sass');
const withImages = require('next-images');
// eslint-disable-next-line import/no-unresolved
require('dotenv').config();
if (typeof require !== 'undefined') {
require.extensions['.css'] = () => {};
}
const nextConfig = {
env: {
HOST_URL: process.env.HOST_URL,
BUILD_ENV: process.env.BUILD_ENV,
},
webpack: (config, { isServer }) => {
if (isServer) {
const antStyles = /antd\/.*?\/style\/css.*?/;
const origExternals = [...config.externals];
// eslint-disable-next-line no-param-reassign
config.externals = [
// eslint-disable-line
(context, request, callback) => {
// eslint-disable-line
if (request.match(antStyles)) return callback();
if (typeof origExternals[0] === 'function') {
origExternals[0](context, request, callback);
} else {
callback();
}
return null;
},
...(typeof origExternals[0] === 'function' ? [] : origExternals),
];
config.module.rules.unshift({
test: antStyles,
use: 'null-loader',
});
}
return config;
},
};
module.exports = withPlugins(
[
[withImages],
[withCss],
[
withSass,
{
cssModules: true,
cssLoaderOptions: {
localIdentName: '[path]_[local]_[hash:base64:5]',
},
},
],
],
nextConfig,
);
как я могу это исправить?