Skip to content

Commit

Permalink
chore: 🔧 set alias for webpack, jest and tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
xingwanying committed Apr 22, 2021
1 parent ad78bb4 commit 3f5afbc
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
7 changes: 0 additions & 7 deletions .eslintrc
Expand Up @@ -16,13 +16,6 @@
},
"parser": "@typescript-eslint/parser",
"plugins": ["prettier", "@typescript-eslint", "import"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"project": "./tsconfig.json",
"sourceType": "module"
},
"settings": {
"jest": {
"version": 26
Expand Down
3 changes: 3 additions & 0 deletions packages/s2-core/package.json
Expand Up @@ -122,6 +122,9 @@
"transform": {
"\\.(less|css)$": "jest-less-loader",
"\\.svg$": "jest-raw-loader"
},
"moduleNameMapper": {
"^src/(.*)": "<rootDir>/src/$1"
}
}
}
18 changes: 9 additions & 9 deletions packages/s2-core/src/components/sheets/base-sheet/index.tsx
@@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import { isEmpty, debounce, isFunction } from 'lodash';
import { Spin } from 'antd';
import { DataCfg } from '@src/common/interface';
import { DrillDown } from '@src/components/drill-down';
import { Header } from '@src/components/header';
import { DataCfg } from 'src/common/interface';
import { DrillDown } from '../../drill-down';
import { Header } from '../../header';
import {
KEY_COLUMN_CELL_CLICK,
KEY_CORNER_CELL_CLICK,
Expand All @@ -13,18 +13,18 @@ import {
HandleConfigWhenDrillDown,
HandleOptions,
HandleDrillDown,
} from '@src/index';
} from 'src/index';
import {
KEY_AFTER_HEADER_LAYOUT,
KEY_COL_NODE_BORDER_REACHED,
KEY_ROW_NODE_BORDER_REACHED,
KEY_CELL_SCROLL,
KEY_LIST_SORT,
} from '@src/common/constant';
import BaseSpreadsheet from '@src/sheet-type/base-spread-sheet';
import SpreadSheet from '@src/sheet-type/spread-sheet';
import { safetyDataCfg, safetyOptions } from '@src/utils/safety-config';
import { resetDrillDownCfg } from '@src/utils/drill-down/helper';
} from 'src/common/constant';
import BaseSpreadsheet from 'src/sheet-type/base-spread-sheet';
import SpreadSheet from 'src/sheet-type/spread-sheet';
import { safetyDataCfg, safetyOptions } from 'src/utils/safety-config';
import { resetDrillDownCfg } from 'src/utils/drill-down/helper';
import { BaseSheetProps } from '../interface';

export const BaseSheet = (props: BaseSheetProps) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-core/src/components/sheets/interface.ts
Expand Up @@ -24,7 +24,7 @@ export interface PartDrillDown {
drillItemsNum?: number;
// Decide the drill down icon show in which levels according to the row header labels.
customDisplayByRowName?: {
//The names of row header labes.
// The names of row header labes.
// Using the ID_SEPARATOR('[&]') to join two labels when there are hierarchical relations between them.
rowNames: string[];
// omit(default): the all levels included in rowNames would hide the drill down icon.
Expand Down
4 changes: 4 additions & 0 deletions packages/s2-core/tsconfig.json
Expand Up @@ -12,6 +12,10 @@
"esModuleInterop": true,
"downlevelIteration": true,
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {
"src/*": ["./src/*"],
},
"lib": [
"esnext",
"dom"
Expand Down
4 changes: 4 additions & 0 deletions packages/s2-core/webpack.config.js
@@ -1,5 +1,6 @@
const webpack = require('webpack');
const resolve = require('path').resolve;
const path = require('path');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin;

Expand All @@ -16,6 +17,9 @@ module.exports = {
path: resolve(__dirname, './dist'),
},
resolve: {
alias: {
src: path.resolve(__dirname, './src'),
},
extensions: ['.tsx', '.ts', '.js', '.less'],
},
module: {
Expand Down

0 comments on commit 3f5afbc

Please sign in to comment.