I have a library with .ts
files in it, while trying to import dynamically using loadable/components am getting error as:
Error: TypeScript emitted no output for C:\E\Platform-x Publish Prelem\Develop next\platform-x-user-experience\node_modules\platform-x-prelems\prelems\contactUs\ContactUs.d.ts.
index.js
import loadable from '@loadable/component';
const name = 'ContactUs'
const Component = loadable(() => import(`platform-x-prelems/prelems/${name}`));
next.config.js
of project
module.exports = {
reactStrictMode: true,
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.module.rules.push({
test: /\.(ts)$/,
loader: "ts-loader",
options: { allowTsInNodeModules: true,compilerOptions: {noEmit: false} }
});
return config;
},
};