can not generate d.ts in nextjs
moliyu opened this issue · comments
moliyu commented
moliyu commented
here is my config
/** @type {import('next').NextConfig} */
const withLess = require('next-with-less')
const AutoImport = require('unplugin-auto-import/webpack')
const { resolve } = require('path')
// const nextConfig = {
// reactStrictMode: true,
// }
module.exports = withLess({
reactStrictMode: true,
lessLoaderOptions: {
lessOptions: {
javascriptEnabled: true
},
},
webpack: config => {
config.plugins.push(AutoImport({
imports: ['react'],
// dts: resolve(__dirname, 'auto-imports.d.ts')
}))
return config
}
})
Anthony Fu commented
We temporarily close this due to the lack of enough information. Please provide a minimal reproduction to reopen the issue. Thanks.
TrungRueta commented
@antfu @moliyu
Hi Antfu, moliyu.
I can confirm Moliyu's issue. I created new fresh latest Nextjs and add auto-import webpack plugin, serve alias for package classnames
as default import and plugin not render d.ts file.
This is codesandbox.
https://codesandbox.io/s/nextjs-unplugin-auto-import-hg3sj?file=/next.config.js
Can you help review this case.
Thank!