File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
const fs = require ( 'fs' )
2
- const path = require ( 'path' )
3
- const helperModuleImports = require ( '@babel/helper-module-imports' )
2
+ import * as helperModuleImports from '@babel/helper-module-imports'
3
+ import * as fs from 'node:fs'
4
4
5
5
/**
6
6
* Converts an AST type into a javascript string so that it can be added to the error message lookup.
@@ -55,7 +55,7 @@ const evalToString = (ast) => {
55
55
* throw new Error(node.process.NODE_ENV === 'production' ? 0 : "This is my error message.");
56
56
* throw new Error(node.process.NODE_ENV === 'production' ? 1 : "This is a second error message.");
57
57
*/
58
- module . exports = ( babel ) => {
58
+ export const mangleErrorsPlugin = ( babel ) => {
59
59
const t = babel . types
60
60
// When the plugin starts up, we'll load in the existing file. This allows us to continually add to it so that the
61
61
// indexes do not change between builds.
@@ -157,3 +157,5 @@ module.exports = (babel) => {
157
157
} ,
158
158
}
159
159
}
160
+
161
+ export default mangleErrorsPlugin
You can’t perform that action at this time.
0 commit comments