swc-plugin-import-meta-hot
v0.1.3
Published
@swc plugin for handling the transformation of import.meta.hot and import.meta.env
Readme
swc-plugin-import-meta-hot
Simple plugin to transform
import.meta.hottoprocess.env
This @swc plugin provides a simple transformation from import.meta.hot to module.hot.
Install 🌱
npm i -D swc-plugin-import-meta-hotUsage 🚀
Simply add this to the plugins field of your .swcrc.
{
"jsc": {
"experimental": {
"plugins": [["swc-plugin-import-meta-hot", {}]]
}
}
}Or programmatically as an extension to your existing .swcrc parsing:
const swcrc = JSON.parse(fs.readFileSync(".swcrc", "utf8"));
((swcrc.jsc ??= {}).experimental ??= {}).plugins = [
["swc-plugin-import-meta-hot", {}],
]; // This may need updating to suit your requirements