Skip to content

Commit

Permalink
Help ts-node find path aliases in build:packs
Browse files Browse the repository at this point in the history
  • Loading branch information
stwlam committed Mar 12, 2021
1 parent 7302716 commit b515ec5
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = {
'^@item/(.*)$': '<rootDir>/src/item/$1',
'^@module/(.*)$': '<rootDir>/src/module/$1',
'^@scripts/(.*)$': '<rootDir>/src/scripts/$1',
'^@utils$': '<rootDir>/src/module/utils.ts',
},
setupFiles: [
'./tests/setup.ts',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"version": "1.11.13",
"description": "",
"scripts": {
"build": "ts-node ./packs/scripts/build.ts && webpack --mode production",
"build": "npm run build:packs && webpack --mode production",
"build:dev": "npm run build:packs && webpack",
"build:packs": "ts-node ./packs/scripts/build.ts",
"build:packs": "ts-node -r tsconfig-paths/register ./packs/scripts/build.ts",
"extractPacks": "ts-node ./packs/scripts/extract.ts",
"pretest": "eslint ./src --ext .ts",
"test": "jest",
Expand Down
2 changes: 1 addition & 1 deletion packs/scripts/packman/compendium-pack.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { sluggify } from '@module/utils';
import * as fs from 'fs';
import * as path from 'path';
import { sluggify } from '@module/utils';

export interface PackMetadata {
system: string;
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
} from '../rules/rules-data-definitions';
import { PF2EPhysicalItem } from '@item/physical';
import { PF2RollNote } from '../notes';
import { objectHasKey } from '@utils';
import { objectHasKey } from '@module/utils';

export const SKILL_DICTIONARY = Object.freeze({
acr: 'acrobatics',
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/character.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
} from './data-definitions';
import { PF2RollNote } from '../notes';
import { PF2MultipleAttackPenalty, PF2WeaponPotency } from '../rules/rules-data-definitions';
import { toNumber } from '@utils';
import { toNumber } from '@module/utils';
import { adaptRoll } from '@system/rolls';
import { AncestryPF2e } from '@item/ancestry';
import { BackgroundPF2e } from '@item/background';
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/macros/travel/travel-speed-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TravelDuration,
Trip,
} from './travel-speed';
import { Fraction, zip } from '@utils';
import { Fraction, zip } from '@module/utils';
import { ActorPF2e } from '@actor/base';

type DetectionModeData = 'none' | 'everything' | 'before';
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/macros/travel/travel-speed.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sum, Fraction } from '@utils';
import { sum, Fraction } from '@module/utils';

/**
* Implementation of travel speed https://2e.aonprd.com/Rules.aspx?ID=470
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"@item/*": ["src/module/item/*"],
"@module/*": ["src/module/*"],
"@scripts/*": ["src/scripts/*"],
"@system/*": ["src/module/system/*"],
"@utils": ["src/module/utils"]
"@system/*": ["src/module/system/*"]
},
"types": [
"jquery",
Expand Down
1 change: 0 additions & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ const config: Configuration = {
'@module': path.resolve(__dirname, 'src/module'),
'@scripts': path.resolve(__dirname, 'src/scripts'),
'@system': path.resolve(__dirname, 'src/module/system'),
'@utils': path.resolve(__dirname, 'src/module/utils.ts'),
},
extensions: ['.ts'],
},
Expand Down

0 comments on commit b515ec5

Please sign in to comment.