我在雪包中有以下配置:
/** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
mount: {
public:{ url: '/', static: true },
src: { url: '/dist' },
runtime: { url: '/runtime' },
},
plugins: [
'@snowpack/plugin-typescript',
['@snowpack/plugin-babel',
{
'input': ['.ts', '.tsx'],
}
]
],
packageOptions: {
/* ... */
},
devOptions: {
/* ... */
},
buildOptions: {
/* ... */
},
};
这是在我的声明文件中index.d.ts
,但是当我启动开发服务器时,Snowpack 没有读取它。
declare global {
namespace JSX {
interface IntrinsicElements {
[elName: string]: any;
}
}
}
让它工作的唯一方法是将文件名更改为index.ts