Using vite js to bundle my library, I need to provide two versions at the same time:
- production usage
- development specific code and warnings with devtools integration.
When I was using webpack, I had:
module.exports = [
defaultUmdBuild("production"),
defaultUmdBuild("development"),
];
which outputs two files and then I have this entrypoint to my library:
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./mylib.production.js');
} else {
module.exports = require('./mylib.development.js');
}
How to do the same using vite ?
Thanks.