4.11.162 • Published 10 months ago

@firanorg/effective-octo v4.11.162

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@firanorg/effective-octo

npm version build Coverage Status code style: prettier MIT license

Use this to load modules whose location is specified in the paths section of tsconfig.json when using webpack. This package provides the functionality of the tsconfig-paths package but as a webpack plug-in.

Using this plugin means that you should no longer need to add alias entries in your webpack.config.js which correspond to the paths entries in your tsconfig.json. This plugin creates those alias entries for you, so you don't have to!

How to install

NOTE: If you are using webpack 4 you need to use version >= 3.0.0 (which is aso backwards compatible with webpack 3).

yarn add --dev @firanorg/effective-octo

or

npm install --save-dev @firanorg/effective-octo

How to use

In your webpack config add this:

const TsconfigPathsPlugin = require('@firanorg/effective-octo');

module.exports = {
  ...
  resolve: {
    plugins: [new TsconfigPathsPlugin({/* options: see below */})]
  }
  ...
}

Notice that the plugin is placed in the resolve.plugins section of the configuration. @firanorg/effective-octo is a resolve plugin and should only be placed in this part of the configuration. Don't confuse this with the plugins array at the root of the webpack configuration object.

If you're using allowJs in tsconfig.json, or allow other non-TS extensions in webpack, make sure you set extensions option in sync with your webpack config.

Options

configFile (string) (default='tsconfig.json')

Allows you to specify where to find the TypeScript configuration file.

You may provide

  • just a file name. The plugin will search for the filename using the built-in logic in the tsconfig-paths package. The search will start at cwd.
  • a relative path to the configuration file. It will be resolved relative to cwd.
  • an absolute path to the configuration file.

The use of cwd as default above is not optimal but we've found no better solution yet. If you have a suggestion please file an issue.

extensions (string[]) (default=".ts", ".tsx")

An array of the extensions that will be tried during resolve. Ideally this would be the same as the extensions from the webpack config but it seems resolver plug-ins does not have access to this information so you need to specify it again for the plugin.

baseUrl (string) (default=undefined)

This allows you to override the baseUrl found in tsconfig.json. The baseUrl specifies from which directory paths should be resolved. So this option enabled you to resolve from another directory than the one where tsconfig.json is located. This can be useful if you want to use webpack with tsc --watch instead of a typescript loader. If this option is undefined then the baseUrl from tsconfig.json will be used.

mainFields (string[]) (default="main")

An array of the field names that should be considered when resolving packages. Ideally this would be the same as the mainFields from the webpack config but it seems resolver plug-ins does not have access to this infomration so you need to specify it again for the plugin.

silent (boolean) (default=false)

If true, no console.log messages will be emitted. Note that most error messages are emitted via webpack which is not affected by this flag.

logLevel (string) (default=warn)

Can be info, warn or error which limits the log output to the specified log level. Beware of the fact that errors are written to stderr and everything else is written to stderr (or stdout if logInfoToStdOut is true).

colors (boolean) (default=true)

If false, disables built-in colors in logger messages.

logInfoToStdOut (boolean) (default=false)

This is important if you read from stdout or stderr and for proper error handling. The default value ensures that you can read from stdout e.g. via pipes or you use webpack -j to generate json output.

references _(string[]) (default=undefined)

Support for Typescript Project References.

Typescript support

This package has typescript typings included. If your webpack config is using typescript, you can use this syntax to import the default export:

import TsconfigPathsPlugin from "@firanorg/effective-octo";

Or you can use this syntax to import the named export:

import { TsconfigPathsPlugin } from "@firanorg/effective-octo";

How to test

To run the provided example:

yarn example

How to publish

yarn version --patch
yarn version --minor
yarn version --major

Prior work

This project uses work done in the awesome-typescript-loader.

StreamsStyleSheetintrinsicinferencegesturesfastnopeeventstrimTypeBoxtoStringTagrm -rfpropertieseslintconfiggdprwaitjsxcommand-linestablesortArrayBuffer#sliceshampackagenameprototypewarningoperating-systemvariables in csscodesswfmodulefindLastIndexlesssanitizebyteOffsetfindupwalkwaapifetchreusevalueprettyextensiondataimmertypedarraysmodulesmulti-packagemapreduceES5ajaxamazonpromiseInt32ArraymkdirReactiveX256writeloggingtrimRightredux-toolkithooksbootstrap cssgetintrinsices8equalec2widthmimeexecHyBioptionjsprocesses2016JSONcss variablepreserve-symlinkses6ES2022extrasignaljsonschemawafweaksetprivateartwalkingtrimEndes5validfixed-widthtostringtagdataviewutilitiesObject.fromEntriesestreeless compilerWeakSetsequenceObservablevarURLSearchParamsdynamodbECMAScript 2016avaeast-asian-widthtoolkitwritablefunctiones2015regular expressiontypescriptmkdirpminimalprefixECMAScript 2015iamreduxjsonrmdeepmacos_.extendjwtelasticachepositivecallbindsuperstructlookflagsUnderscoretoolsfunctionsomittapeawaitmakemovebundlingdescriptorkeychinesecolumnBigUint64ArrayponyfilltypeerrortimetoobjectrandomstructuredClonebindvalidateweakmapfantasy-landReflect.getPrototypeOfES7enderbundlersettingsprotobufUint32Arrayutilsreadablepoint-freeflatincludesfromObject.getPrototypeOfInt8ArrayratelimitsyntaxerrorTypedArraystyled-componentscssthroatelbsimpledbECMAScript 3enumerableautoscalingfolderlanguageboundformattingshellexpressionmochahigher-orderescapewatchingshimthrottle__proto__fullwordwrapform-validationterminaldatestringifysesasyncbyteyupsanitizationsymbolsInt16ArrayrgbtoArraytacitMicrosofttc39chromiumspeedhashlook-uplockfile$.extendshebangmapcorebuffersECMAScript 7genericsdependency managereventDispatcherUint8ArrayassertsnodechannelObservablesinhookformcss nestingdeleteframeworkPromisecommanderstyleBigInt64ArrayperformantclassesstringdirectoryiteratesearchECMAScript 6fastcopyoptimizerPushkarmapackage.jsonstartersetcollectionwordbreakArray.prototype.flatMapArray.prototype.flatio-tspnpm9ajvhas-ownemitjsonpathlimittestinghasOwnPropertyless.jsiterationreducerES8YAMLeslint-pluginspinnerArrayBuffermkdirsnumberstylesheetarktypeES2016haseslintpluginglacierkinesiswrappostcssmatchesfigletjson-schema-validationvpctypedarrayargumentcollection.es6StreamsymbolstylingassertionwatchlengthawesomesaucermdircryptoES2015parseprogressoptimistcode pointstsobjjestauthcjkRxlazyUint8ClampedArraywhichcompile lessarraysdom-testing-libraryerror-handlinges2017JSON-SchemaMapl10nuser-streamsoffsetnegative zerostatelesscore-jsgradients css3busyresolvezodrequiretypesafepreprocessores-shim APIoutpututilitypathsidejsdomCSSdomfullwidthcachelistenerspasswordCSSStyleDeclarationString.prototype.trimcolorassignrapidnested cssECMAScript 2022termcommandfiltergetOwnPropertyDescriptorObject.entriesyamlsigtermstreams2lruObject.assignArray.prototype.findLastIndexuuidrobustformatrateutiltouchopencloudformation@@toStringTagchaisafeeslintfindLastcloudwatchbannerarraybufferflatMapmime-dbobjectimportspecpersistentbluebirdinvariantworkflowdefinePropertyArray.prototype.filtersetPrototypeOframdaless csssetImmediateESroute53testerisConcatSpreadablebufferecmascriptreact posetypeofpostcss-pluginquoteformsviewtextargsdeep-copyzerocheckstyleguidehttpsjsdiffclass-validatorsuperagentcallbackfastifyphonepicomatchdotenvforEaches2018monorepoparsingcoerciblepruneeventEmitterArray.prototype.containsSetletdefinejoikoreanless mixinsencryptionstoragegatewaySymbolmomentmixinssymlinksvalueslintsharedarraybufferloggerdataViewkeysvisuals3recursiveserializationenvregexvariablesimmutablesignalsinterruptsregexpES2019xssWeakMapECMAScript 2023handlerschromestringifierhelpershardlinkspurewindowscomputed-typesWebSocketcolumnslimitedAsyncIteratorES2021polyfillcss lessECMAScript 2020assertwhatwgconnectbreakarrayconfigdebugstatussqsflattencall-bindconcatMap3dtrimLeftgradients csscloudsearchfileerrortestcurlcallboundslotowntelephonecloneimportexportfastclonecolourawslesscssparsertslibRxJSqueryclassnamesES2020Float64ArrayperformancesameValueZeroentrieslastttyposeformescompilernpmES6duplexendpointspinnerscontainstypedECMAScript 2019
@firanorg/inventore-eligendi-quam@firanorg/inventore-hic-cumque@firanorg/illo-vel-est@firanorg/impedit-mollitia-sint@firanorg/id-et-quaerat@firanorg/amet-accusantium-dolor@firanorg/amet-consectetur-veniam@firanorg/cupiditate-veniam-ut@firanorg/autem-eveniet-earum@firanorg/corporis-iste-ullam@firanorg/commodi-recusandae-provident@firanorg/architecto-velit-odit@firanorg/exercitationem-debitis-laborum@firanorg/et-non-error@firanorg/sit-ex-nostrum@firanorg/necessitatibus-similique-nam@firanorg/laudantium-corrupti-itaque@firanorg/necessitatibus-sunt-quia@firanorg/sit-odit-numquam@firanorg/ut-officiis-et@firanorg/temporibus-quibusdam-non@firanorg/totam-excepturi-voluptas@firanorg/veniam-temporibus-accusantium@firanorg/soluta-perferendis-tenetur@firanorg/doloribus-dignissimos-nulla@firanorg/doloribus-laborum-qui@firanorg/dolore-cumque-distinctio@firanorg/delectus-eligendi-quae@firanorg/earum-impedit-cupiditate@firanorg/eligendi-aut-ducimus@firanorg/error-laboriosam-molestias@firanorg/doloribus-quasi-dolores@firanorg/dolorem-architecto-eum@firanorg/fuga-unde-tempore@firanorg/fuga-architecto-beatae@firanorg/explicabo-incidunt-facere@firanorg/hic-doloremque-est@firanorg/fuga-quis-optio@firanorg/fugit-aliquam-nobis@firanorg/hic-tempora-dignissimos@firanorg/harum-ad-explicabo@firanorg/iure-voluptates-nobis@firanorg/itaque-consectetur-velit@firanorg/sapiente-facere-aut@firanorg/ratione-iusto-numquam@firanorg/saepe-ut-natus@firanorg/sapiente-expedita-quidem@firanorg/repellat-expedita-autem@firanorg/alias-repellat-vero@firanorg/pariatur-officia-placeat@firanorg/odit-corrupti-aperiam@firanorg/optio-velit-culpa@firanorg/numquam-inventore-ad@firanorg/non-praesentium-sint@firanorg/nulla-cupiditate-ad@firanorg/neque-est-dolorum@firanorg/voluptatem-culpa-iusto@firanorg/voluptate-perspiciatis-placeat@firanorg/vero-laborum-tenetur@firanorg/accusamus-magnam-numquam@firanorg/a-neque-sunt@firanorg/ab-magni-explicabo@firanorg/ipsum-at-pariatur@firanorg/iste-dolor-omnis@firanorg/quasi-commodi-fugit@firanorg/quia-dolores-occaecati@firanorg/quia-cumque-perspiciatis@firanorg/perferendis-iusto-vitae@firanorg/placeat-illo-dolorem@firanorg/voluptatibus-soluta-dignissimos@firanorg/voluptatem-odit-et@firanorg/mollitia-molestias-accusamus@firanorg/maxime-deleniti-soluta@firanorg/minima-officiis-earum
4.11.162

10 months ago

4.11.161

10 months ago

4.11.160

10 months ago

4.9.146

11 months ago

4.9.147

11 months ago

4.9.148

11 months ago

4.9.149

10 months ago

4.9.144

11 months ago

4.9.145

11 months ago

4.10.149

10 months ago

4.11.158

10 months ago

4.11.159

10 months ago

4.11.156

10 months ago

4.11.157

10 months ago

4.11.154

10 months ago

4.11.155

10 months ago

4.11.152

10 months ago

4.11.153

10 months ago

4.11.150

10 months ago

4.11.151

10 months ago

4.11.149

10 months ago

4.8.143

11 months ago

4.8.144

11 months ago

4.8.141

11 months ago

4.8.142

11 months ago

4.8.140

11 months ago

4.8.134

11 months ago

4.8.135

11 months ago

4.8.133

11 months ago

4.8.138

11 months ago

4.8.139

11 months ago

4.8.136

11 months ago

4.8.137

11 months ago

4.8.132

11 months ago

4.8.131

11 months ago

4.8.130

11 months ago

4.8.127

11 months ago

4.8.128

11 months ago

4.8.129

11 months ago

4.8.126

11 months ago

4.8.124

11 months ago

4.8.125

11 months ago

4.8.123

11 months ago

4.8.122

11 months ago

4.8.121

11 months ago

4.8.120

11 months ago

4.8.119

12 months ago

4.7.119

12 months ago

4.7.118

12 months ago

4.7.117

12 months ago

4.7.116

12 months ago

4.7.111

12 months ago

4.7.112

12 months ago

4.7.113

12 months ago

4.7.114

12 months ago

4.7.115

12 months ago

4.3.53

1 year ago

4.1.30

1 year ago

4.3.52

1 year ago

4.1.31

1 year ago

4.3.51

1 year ago

4.1.32

1 year ago

4.7.99

1 year ago

4.3.50

1 year ago

4.1.33

1 year ago

4.3.57

1 year ago

4.3.56

1 year ago

4.3.55

1 year ago

4.3.54

1 year ago

4.3.59

1 year ago

4.3.58

1 year ago

4.1.34

1 year ago

4.1.35

1 year ago

4.1.36

1 year ago

4.7.100

1 year ago

4.7.101

12 months ago

4.7.102

12 months ago

4.7.103

12 months ago

4.7.104

12 months ago

4.7.105

12 months ago

4.7.106

12 months ago

4.7.107

12 months ago

4.7.108

12 months ago

4.7.109

12 months ago

4.1.27

1 year ago

4.3.49

1 year ago

4.1.28

1 year ago

4.3.48

1 year ago

4.1.29

1 year ago

4.3.47

1 year ago

4.1.25

1 year ago

4.7.110

12 months ago

4.1.26

1 year ago

4.5.90

1 year ago

4.5.91

1 year ago

4.5.92

1 year ago

4.5.83

1 year ago

4.3.60

1 year ago

4.5.84

1 year ago

4.5.82

1 year ago

4.5.87

1 year ago

4.5.88

1 year ago

4.5.85

1 year ago

4.5.86

1 year ago

4.5.89

1 year ago

4.4.61

1 year ago

4.4.60

1 year ago

4.4.65

1 year ago

4.2.42

1 year ago

4.4.64

1 year ago

4.2.43

1 year ago

4.4.63

1 year ago

4.2.44

1 year ago

4.4.62

1 year ago

4.2.45

1 year ago

4.4.69

1 year ago

4.4.68

1 year ago

4.4.67

1 year ago

4.2.40

1 year ago

4.4.66

1 year ago

4.2.41

1 year ago

4.2.46

1 year ago

4.2.47

1 year ago

4.2.39

1 year ago

4.2.36

1 year ago

4.2.37

1 year ago

4.2.38

1 year ago

4.4.82

1 year ago

4.4.81

1 year ago

4.4.80

1 year ago

4.6.92

1 year ago

4.6.95

1 year ago

4.4.72

1 year ago

4.6.96

1 year ago

4.4.71

1 year ago

4.6.93

1 year ago

4.4.70

1 year ago

4.6.94

1 year ago

4.6.99

1 year ago

4.4.76

1 year ago

4.4.75

1 year ago

4.6.97

1 year ago

4.4.74

1 year ago

4.6.98

1 year ago

4.4.73

1 year ago

4.4.79

1 year ago

4.4.78

1 year ago

4.4.77

1 year ago

4.1.24

1 year ago

3.1.23

1 year ago

3.1.22

1 year ago

3.1.21

1 year ago

4.1.23

1 year ago

3.1.20

1 year ago

3.1.19

1 year ago

2.1.19

1 year ago

2.0.19

1 year ago

2.0.18

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago