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:
@@ -1,9 +1,23 @@
|
|||||||
|
const { resolve } = require('path');
|
||||||
const wp = require('@cypress/webpack-preprocessor');
|
const wp = require('@cypress/webpack-preprocessor');
|
||||||
|
|
||||||
|
const anyNodeModules = /node_modules/;
|
||||||
|
const packageRoot = resolve(`${__dirname}/../../`);
|
||||||
|
const packageModules = `${packageRoot}/node_modules`;
|
||||||
|
|
||||||
const webpackOptions = {
|
const webpackOptions = {
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
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$/,
|
test: /\.ts$/,
|
||||||
use: [
|
use: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"declaration": false,
|
||||||
|
"module": "commonjs",
|
||||||
"types": ["cypress"]
|
"types": ["cypress"]
|
||||||
},
|
},
|
||||||
"extends": "../tsconfig.json",
|
"extends": "@grafana/tsconfig",
|
||||||
"include": ["**/*.ts"]
|
"include": ["**/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user