Open kien8995 opened 2 years ago
I've written a simple vite plugin applying the transformers:
const { di } = require('@wessberg/di-compiler');
const typescript = require('rollup-plugin-ts');
module.exports = function (options = {}) {
return {
name: 'vite:di',
enforce: 'pre',
...typescript({
...options,
transformers: [di],
transpileOnly: true,
exclude: ['**/*.test.ts'],
tsconfig: (resolvedConfig) => ({ ...resolvedConfig, declaration: false }),
}),
};
};
Adjust options and config to your needs and you should be good to go.
How i can use
DI-compiler
withVite.js
?