mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Replace ts-loader in e2e and input-datasource (#76872)
* build(npm): remove ts-loader from core and input-datasource * build(input-datasource): update webpack config to use swc-loader * chore(e2e): replace ts-loader with esbuild-loader
This commit is contained in:
@@ -1,32 +1,18 @@
|
||||
const wp = require('@cypress/webpack-preprocessor');
|
||||
const { resolve } = require('path');
|
||||
|
||||
const anyNodeModules = /node_modules/;
|
||||
const packageRoot = resolve(`${__dirname}/../../`);
|
||||
const packageModules = `${packageRoot}/node_modules`;
|
||||
|
||||
const webpackOptions = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
include: (modulePath) => {
|
||||
if (!anyNodeModules.test(modulePath)) {
|
||||
// Is a file within the project
|
||||
return true;
|
||||
} else {
|
||||
// Is a file within this package
|
||||
return modulePath.startsWith(packageRoot) && !modulePath.startsWith(packageModules);
|
||||
}
|
||||
},
|
||||
test: /\.ts$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
transpileOnly: true,
|
||||
},
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'esbuild-loader',
|
||||
options: {
|
||||
target: 'es2020',
|
||||
format: undefined,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user