()
| 36 | const fixtureFile = /\/test\/fixtures\/.+\.js$/; |
| 37 | |
| 38 | export function commonjsFixtures() { |
| 39 | return { |
| 40 | name: 'chartjs-commonjs-fixtures', |
| 41 | enforce: 'pre', |
| 42 | transform(code, id) { |
| 43 | if (!fixtureFile.test(id.split('?')[0]) || !code.includes('module.exports')) { |
| 44 | return null; |
| 45 | } |
| 46 | // Prepended on the first line, so line numbers in errors stay the file's. |
| 47 | return { |
| 48 | code: 'const module = {exports: {}}; ' + code + '\nexport default module.exports;\n', |
| 49 | map: null |
| 50 | }; |
| 51 | } |
| 52 | }; |
| 53 | } |
no outgoing calls
no test coverage detected