[BABEL] Note: The code generator has deoptimised the styling
Unanswered
Bohemian Waxwing posted this in #help-forum
Bohemian WaxwingOP
I'm installed PWA and my public folder do have almost 1mb of images.
How can I config babel in next.config.js to disable babel compact?
How can I config babel in next.config.js to disable babel compact?
1 Reply
Bohemian WaxwingOP
Here is my next.config.js
----
/** @type {import('next').NextConfig} /
import withPWA from 'next-pwa';
const nextConfig = {
reactStrictMode: true, // Enable React strict mode for improved error handling
swcMinify: true, // Enable SWC minification for improved performance
compiler: {
removeConsole: process.env.NODE_ENV !== 'development', // Remove console.log in production
},
async rewrites() {
return [
{
source: '/pages/api/:path',
destination: 'http://localhost:3051/:path*',
},
];
},
};
export default withPWA({
dest: 'public', // destination directory for the PWA files
disable: process.env.NODE_ENV === 'development', // disable PWA in the development environment
register: true, // register the PWA service worker
skipWaiting: true, // skip waiting for service worker activation
})(nextConfig);
----
/** @type {import('next').NextConfig} /
import withPWA from 'next-pwa';
const nextConfig = {
reactStrictMode: true, // Enable React strict mode for improved error handling
swcMinify: true, // Enable SWC minification for improved performance
compiler: {
removeConsole: process.env.NODE_ENV !== 'development', // Remove console.log in production
},
async rewrites() {
return [
{
source: '/pages/api/:path',
destination: 'http://localhost:3051/:path*',
},
];
},
};
export default withPWA({
dest: 'public', // destination directory for the PWA files
disable: process.env.NODE_ENV === 'development', // disable PWA in the development environment
register: true, // register the PWA service worker
skipWaiting: true, // skip waiting for service worker activation
})(nextConfig);