mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
@grafana/e2e: correctly exclude dependencies from TypeScript builds (#22732)
* maintains support for Grafana core e2e tests * avoids producing declaration files in plugin source directories
This commit is contained in:
parent
5b7bb267cb
commit
4fecf5a7a6
@ -1,9 +1,23 @@
|
||||
const { resolve } = require('path');
|
||||
const wp = require('@cypress/webpack-preprocessor');
|
||||
|
||||
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: [
|
||||
{
|
||||
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": false,
|
||||
"module": "commonjs",
|
||||
"types": ["cypress"]
|
||||
},
|
||||
"extends": "../tsconfig.json",
|
||||
"extends": "@grafana/tsconfig",
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user