()
| 14 | } |
| 15 | |
| 16 | function rules() { |
| 17 | return { |
| 18 | js: () => ({ |
| 19 | test: /\.(ts|js)x?$/, |
| 20 | exclude: /node_modules/, |
| 21 | use: { |
| 22 | loader: 'babel-loader', |
| 23 | options: { |
| 24 | rootMode: 'upward', |
| 25 | }, |
| 26 | }, |
| 27 | }), |
| 28 | css: () => [ |
| 29 | { |
| 30 | test: /\.css$/, |
| 31 | include: ['ol', 'react-toastify', 'codemirror'].map(moduleNameToPath), |
| 32 | use: ['to-string-loader', 'css-loader'], |
| 33 | }, |
| 34 | ], |
| 35 | svg: () => ({ |
| 36 | test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, |
| 37 | exclude: [/node_modules/], |
| 38 | use: 'svg-inline-loader', |
| 39 | }), |
| 40 | vfile: () => ({ |
| 41 | test: /node_modules\/vfile\/core\.js/, |
| 42 | use: [ |
| 43 | { |
| 44 | loader: 'imports-loader', |
| 45 | options: { |
| 46 | type: 'commonjs', |
| 47 | imports: ['single process/browser process'], |
| 48 | }, |
| 49 | }, |
| 50 | ], |
| 51 | }), |
| 52 | }; |
| 53 | } |
| 54 | |
| 55 | function plugins() { |
| 56 | return { |
no test coverage detected