You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 4, 2021. It is now read-only.
`rollup-plugin-babel` exposes a plugin-builder utility that allows users to add custom handling of Babel's configuration for each file that it processes.
143
+
144
+
`.custom` accepts a callback that will be called with the loader's instance of `babel` so that tooling can ensure that it using exactly the same `@babel/core` instance as the loader itself.
145
+
146
+
It's main purpose is to allow other tools for configuration of transpilation without forcing people to add extra configuration but still allow for using their own babelrc / babel config files.
147
+
148
+
### Example
149
+
150
+
```js
151
+
importbabelfrom'rollup-plugin-babel';
152
+
153
+
exportdefaultbabel.custom(babelCore=> {
154
+
functionmyPlugin() {
155
+
return {
156
+
visitor: {},
157
+
};
158
+
}
159
+
160
+
return {
161
+
// Passed the plugin options.
162
+
options({ opt1, opt2, ...pluginOptions }) {
163
+
return {
164
+
// Pull out any custom options that the plugin might have.
165
+
customOptions: { opt1, opt2 },
166
+
167
+
// Pass the options back with the two custom options removed.
0 commit comments