diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/ts-loader | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/ts-loader')
81 files changed, 0 insertions, 4395 deletions
diff --git a/node_modules/ts-loader/.gitattributes b/node_modules/ts-loader/.gitattributes deleted file mode 100644 index 76af30fe7..000000000 --- a/node_modules/ts-loader/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.ts eol=lf
-*.js eol=lf
diff --git a/node_modules/ts-loader/.npmignore b/node_modules/ts-loader/.npmignore deleted file mode 100644 index de11f4f09..000000000 --- a/node_modules/ts-loader/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -*.ts
-.vscode
-.test
-test
-src
diff --git a/node_modules/ts-loader/.travis.yml b/node_modules/ts-loader/.travis.yml deleted file mode 100644 index d00853eaf..000000000 --- a/node_modules/ts-loader/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: node_js
-node_js:
- - "4"
- - "5"
- - "6"
- - "7"
-sudo: false
-install:
- - npm install npm -g
- - npm install
- - npm run build
- - npm install $TYPESCRIPT
-env:
- - TYPESCRIPT=typescript@1.6.2
- - TYPESCRIPT=typescript@1.7.5
- - TYPESCRIPT=typescript@1.8.2
- - TYPESCRIPT=typescript@2.0.9
- - TYPESCRIPT=typescript@2.1.5
- - TYPESCRIPT=typescript@2.2.1
- - TYPESCRIPT=typescript@2.3.1
- - TYPESCRIPT=typescript@next
diff --git a/node_modules/ts-loader/CHANGELOG.md b/node_modules/ts-loader/CHANGELOG.md deleted file mode 100644 index de7b75702..000000000 --- a/node_modules/ts-loader/CHANGELOG.md +++ /dev/null @@ -1,296 +0,0 @@ -# Changelog
-
-## v2.1.0
-
-- [Add happypack compatibility mode](https://github.com/TypeStrong/ts-loader/pull/547) - thanks @aindlq!
-
-## v2.0.3
-
-- [Don't include appended TS extension in webpack dependencies](https://github.com/TypeStrong/ts-loader/pull/497) - thanks again @wearymonkey!
-
-## v2.0.2
-
-- [Fix performance regression related to using getTimes() by tracking timestamps](https://github.com/TypeStrong/ts-loader/pull/500) - thanks @wearymonkey
-
-## v2.0.1
-
-- [make watch resilient to no watcher / watcher.mtimes](https://github.com/TypeStrong/ts-loader/pull/482) - thanks @bancek and @mredbishop
-- [move to using loader-utils 1.0](https://github.com/TypeStrong/ts-loader/pull/475)
-
-## v2.0.0
-
-- [Add support for IgnoringWatchFileSystem](https://github.com/TypeStrong/ts-loader/pull/444) - thanks @herschel666
-- [Use native Object.assign()](https://github.com/TypeStrong/ts-loader/pull/418) - thanks @arusakov
-
-Breaking changes:
-
-- ts-loader now officially only supports webpack 2. ts-loader 2.x may work with webpack 1 but it is not supported. Related to that, all continuous integration tests now run against webpack 2.
-- as webpack 2 does not support node 0.12 neither does ts-loader from now. node 4 at least is required.
-
-## v1.3.3
-
-- [Fix bug when "extend"ing a tsconfig that specifies "allowJs"](https://github.com/TypeStrong/ts-loader/pull/415) Thanks @cspotcode
-- [Minor perf optimisations](https://github.com/TypeStrong/ts-loader/pull/412)
-
-## v1.3.2
-
-- [Upgrade enhanced-resolve to v3](https://github.com/TypeStrong/ts-loader/pull/411)
-- [Remove arrify dependency](https://github.com/TypeStrong/ts-loader/pull/410)
-
-## v1.3.1
-
-- [Rolled back re-exported const enums no longer break emit in watch mode as performance cost was too high](https://github.com/TypeStrong/ts-loader/pull/406) resolves #393
-
-## v1.3.0
-
-- [Introduce meaningful error when importing TypeScript from `node_modules`](https://github.com/TypeStrong/ts-loader/pull/399)
-- [Introduce `entryFileIsJs` loader option which allows having an entry file which is js.](https://github.com/TypeStrong/ts-loader/pull/399) resolves #388 and #401 - thanks @Wykks and @pqr.
-
-NB Previously the `entryFileIsJs` option was on by default when `allowJs` was true. Now it has to be specified directly. Strictly speaking this is a breaking change; however given this is a rarely used option which exists for what is arguably an edge case this is being added without moving to 2.0. If this breaks people then we'll never do this again; I'd be surprised if anyone is relying on this though so we're taking a chance. Related tests have been suffixed "-entryFileIsJs" in the test name.
-
-## v1.2.2
-
-- [Re-exported const enums no longer break emit in watch mode](https://github.com/TypeStrong/ts-loader/pull/377) [#376] - thanks @smphhh
-- [typescript.sys should be compiler.sys](https://github.com/TypeStrong/ts-loader/pull/380) [#379] - thanks @johnnyreilly and @jbrantly
-
-## v1.2.1
-
-- [Fix TS module resolution paths on Windows - watch mode becomes faster](https://github.com/TypeStrong/ts-loader/pull/373) [#372] - thanks @smphhh
-
-## v1.2.0
-
-- [Crash when adding/removing files in watch-mode](https://github.com/TypeStrong/ts-loader/pull/364) [#358] - thanks @jbbr for the suggested fix
-- [Provided an option to produce Visual Studio compatible error output](https://github.com/TypeStrong/ts-loader/pull/356) [#355] - thanks @gamli
-
-## v1.1.0
-
-- [Added support for vuejs via `appendTsSuffixTo` option](https://github.com/TypeStrong/ts-loader/pull/354) [#270] - thanks @HerringtonDarkholme
-
-## v1.0.0
-
-- [General refactor of ts-loader; some performance improvements](https://github.com/TypeStrong/ts-loader/pull/343) [#335] - thanks @johnnyreilly
-- [Make the loader resilient to watched declaration files being removed.](https://github.com/TypeStrong/ts-loader/pull/281) - thanks @opichals
-
-## v0.9.5
-
-- [Improve performance for watch mode / `after-compile` plugin](https://github.com/TypeStrong/ts-loader/pull/187) - thanks @Strate
-
-## v0.9.4
-
-- [Make logging to stderr or stdout configurable; introduce logging levels](https://github.com/TypeStrong/ts-loader/pull/313) [#214] - thanks @ThYpHo0n
-- [Fix regression that broke hot module replacement](https://github.com/TypeStrong/ts-loader/pull/322) [#321] - thanks @dopare
-
-## v0.9.3
-
-- [Added support for allowJs](https://github.com/TypeStrong/ts-loader/pull/320) (#316) - thanks @dschnare
-
-## v0.9.2
-
-- [Added support for @types](https://github.com/TypeStrong/ts-loader/pull/318) (#247) -thanks @basarat for the ideas
-
-## v0.9.1
-
-- [Normalize dependency graph paths - Fix broken dependencies on Windows ](https://github.com/TypeStrong/ts-loader/pull/286) - thanks @pzavolinsky
-- [Fixed the declaration issue](https://github.com/TypeStrong/ts-loader/pull/307) (#214 part deux) - thanks @dizel3d
-
-## v0.9.0
-
-- [Made ts-loader compatible with node v6](https://github.com/TypeStrong/ts-loader/commit/a4f835345e495f45b40365f025afce72d1817996) - thanks @Blechhirn
-- [Fixed the declaration issue](https://github.com/TypeStrong/ts-loader/commit/3bb0fec73a2fab47953b51d256f0f5378f236ad1) (#214) - thanks @17cupsofcoffee
-- [Declarations update independent of compiler.watchFileSystem](https://github.com/TypeStrong/ts-loader/pull/167/commits/ae824b2676b226bdd0c860a787754a4ae28e339c) (#155) - thanks @opichals
-
-Now built using TypeScript v2.0
-
-## v0.8.2
-
-- Elided imports are now watched (#156, #169)
-- Declaration files for `.d.ts` files are now emitted (thanks @rob-bateman) (#174, #175)
-
-## v0.8.1
-
-- Add better error messaging when a file in tsconfig.json can not be loaded (#117, #145)
-- Fix incompatibility with html-webpack-plugin (#152, #154)
-
-## v0.8.0
-
-- Add support for emitting declaration files when `declaration: true` is set (#48, #128)
-- Fix bug with specifying `target: es6` and `module: commonjs` at the same time when using
- TS 1.7+ (#111, #132, #140).
-- Fix bug with resolving dependencies which are linked using `npm link` (#134, #141)
-
-## v0.7.2
-
-- Fix regression with watching definition files (#109, #110)
-
-## v0.7.1
-
-- Fix regression with Windows that was introduced in v0.7.0 (#92)
-
-## v0.7.0
-
-- Fix bug with webpack resolution that could sometimes cause TypeScript to not find modules (#92, #102)
-- Loader output is now written to stderr instead of stdout. (#95, #103)
-
-## v0.6.1
-
-- Improve initial build performance significantly for larger projects (#100)
-- Fix issue with nightly (#96)
-
-## v0.6.0
-
-- Remove support for 1.5 and 1.6-beta. TypeScript 1.6 (stable) is the now the lowest version
- supported.
-- Fix issue when using source maps and Babel in certain situations (#81)
-- Fix issue with nightly (#83)
-
-## v0.5.6
-
-- Add ignoreDiagnostics feature
-- Fix issue with node resolution and `noEmitOnError` (#71)
-
-## v0.5.5
-
-- Fix issue with nightly (Microsoft/TypeScript#4738)
-- Add support for the NoErrorsPlugin
-
-## v0.5.4
-
-- Fix issue with nightly (Microsoft/TypeScript#4497)
-
-## v0.5.3
-
-- Utilize TypeScript's new custom module resolution logic to integrate with webpack. This essentially
- means that TypeScript will resolve files exactly the same as webpack does (supporting aliases, etc).
- See the [aliasResolution test](test/aliasResolution) for an example. Only supported in TS 1.6 and
- above.
-- Rework error reporting to resolve certain edge cases with dependencies. In general errors should
- be much more consistent now in watch mode.
-- Fix issue with targeting ES6 and transpile mode (#36)
-
-## v0.5.2
-
-- Fix issue with TypeScript nightly and new node module resolution strategy (#34)
-
-## v0.5.1
-
-- Tweaked error message output to include error code (#32)
-- Add helpful messages around the TypeScript dependency
- - Suggest how to install TypeScript if it hasn't been installed
- - Show TypeScript version when compiling
- - Warn if TypeScript version is incompatible
-
-## v0.5.0
-
-- Add support for `transpileOnly` loader option. See README for more information.
-- TypeScript is no longer a dependency of the loader and must be installed separately
-- Loader options can now be set as a property in `webpack.config.js`
-- TypeScript options can be set through the loader option `compilerOptions`
-- Improved error reporting
- - Errors from all files in the TypeScript application are now reported in watch mode instead of
- from just those files that changed. This means that making a breaking change in a dependency
- will now be correctly reported as an error in the dependent file.
- - Errors with TypeScript options are now reported as webpack errors instead of logged to console
- - Error output no longer contains the filename once from webpack and again in the error message.
- Instead, the filename is only reported by webpack
- - Fixed issue with latest version of webpack where filenames could be reported twice for the same
- error in certain situations
-- Using the `declaration` TypeScript option no longer results in errors
-- Add support for the `newLine` TypeScript option
-- Tests have been revamped to be full integration tests with nightly builds against the current stable
- and nightly TypeScript. Many new tests have been added.
-
-## v0.4.7
-
-- Update TypeScript dependency to 1.5 release (1.5.3)
-
-## v0.4.6
-
-- Improve error reporting related to tsconfig.json
- - Fix bug that reported the wrong errors
- - Errors are now reported as webpack errors instead of logged to console
-- Add support for latest TypeScript nightly (#24)
-
-## v0.4.5
-
-- Add `silent` flag (#22)
-
-## v0.4.4
-
-- Add support for "noLib" compiler option (#19)
-- Make errors easier to parse programmatically (#20)
- - Errors in declaration files are now added to the stats object instead of written to console
- - Errors now include `file`, `rawMessage`, and `location` properties
-- Make --watch option more robust
- - Fix issue where changes to entry file were not detected
- - Fix issue where changes to typing information only did not result in a rebuild (#21)
-
-## v0.4.3
-
-- Fix error locations to be 1-based instead of 0-based (#18)
-
-## v0.4.2
-
-- Rework the way dependencies are loaded (#14)
-- Fix NPM dependency on TypeScript (#15, #16)
-
-## v0.4.1
-
-- Fix Windows issue with paths (#14)
-
-## v0.4.0
-
-- TypeScript 1.5 support! (#14)
-- tsconfig.json support (#2, #9)
-- ES6 target support
-- Remove TS-related options in favor of specifying them in tsconfig.json
-- Add `configFileName` option for custom tsconfig files
-
-## v0.3.4
-
-- Exclude TS 1.5 as a dependency since there are breaking changes
-
-## v0.3.3
-
-- Add support for reporting errors in declaration files (#10)
-- Add support for watch mode for declaration files (#11)
-- Fix issue with extra `sourceMappingURL` in output files (#12)
-
-## v0.3.2
-
-- Add support for manually adding files (#6)
-- Add paths to source maps (#8)
-
-## v0.3.1
-
-- Add support for specifying a custom TypeScript compiler
-
-## v0.3.0
-
-- Change how modules are resolved. Imports and declaration file references are
-now resolved through TypeScript instead of being resolved through webpack's
-`resolve` API. This fixes a number of issues and better aligns the loader to
-work as a replacement for the `tsc` command. (#3, #4, #5)
-
-## v0.2.3
-
-- Add noImplicitAny option (#2)
-
-## v0.2.2
-
-- Fix issue with source maps
-
-## v0.2.1
-
-- Add colors to error output
-
-## v0.2.0
-
-- Add new configuration options (#1)
- - target, module, sourceMap, instance
- - sourceMap default changed from `true` to `false`
-- Workaround issue with TypeScript always emitting Windows-style new lines
-- Add tests
-
-## v0.1.0
-
-- Initial version
diff --git a/node_modules/ts-loader/CONTRIBUTING.md b/node_modules/ts-loader/CONTRIBUTING.md deleted file mode 100644 index 25578ff83..000000000 --- a/node_modules/ts-loader/CONTRIBUTING.md +++ /dev/null @@ -1,62 +0,0 @@ -# Contributer's Guide
-
-We welcome contributions from the community and have gathered guidelines
-here to help you get started.
-
-## Discussion
-
-While not absolutely required, it is encouraged that you first open an issue
-for any bug or feature request. This allows discussion on the proper course of
-action to take before coding begins.
-
-## Building
-
-```shell
-npm install
-npm run build
-```
-
-## Changing
-
-Most of the information you need to contribute code changes can [be found here](https://guides.github.com/activities/contributing-to-open-source/).
-In short: fork, make your changes, and submit a pull request.
-
-## Testing
-
-This project makes use of 2 integration test packs to make sure we don't break anything. That's right, count them, 2! There is a comparison test pack which compares compilation outputs and is long established. There is also an execution test pack which executes the compiled JavaScript. This test pack is young and contains fewer tests; but it shows promise.
-
-You can run all the tests (in both test packs) with `npm test`.
-
-To run comparison tests alone use `npm run comparison-tests`.
-To run execution tests alone use `npm run execution-tests`.
-
-Not all bugs/features necessarily fit into either framework and that's OK. However, most do and therefore you should make every effort to create at least one test which demonstrates the issue or exercises the feature. Use your judgement to decide whether you think a comparison test or an execution test is most appropriate.
-
-To read about the comparison test pack take a look [here](test/comparison-tests/README.md)
-To read about the execution test pack take a look [here](test/execution-tests/README.md)
-
-## Publishing
-
-So the time has come to publish the latest version of ts-loader to npm. Exciting!
-
-Before you can actually publish make sure the following statements are true:
-
-- Tests should be green
-- The version number in [package.json](package.json) has been incremented.
-- The [changelog](CHANGELOG.md) has been updated with details of the changes in this release. Where possible include the details of the issues affected and the PRs raised.
-
-OK - you're actually ready. We're going to publish. Here we need to tread carefully. Follow these steps:
-
-- clone ts-loader from the main repo with this command: `git clone https://github.com/TypeStrong/ts-loader.git`
-- [Login to npm](https://docs.npmjs.com/cli/adduser) if you need to: `npm login`
-- install ts-loaders packages with `npm install`
-- build ts-loader with `npm run build`
-- run the tests to ensure all is still good: `npm test`
-
-If all the tests passed then we're going to ship:
-- tag the release in git. You can see existing tags with the command `git tag`. If the version in your `package.json` is `"1.0.1"` then you would tag the release like so: `git tag v1.0.1`. For more on type of tags we're using read [here](https://git-scm.com/book/en/v2/Git-Basics-Tagging#Lightweight-Tags).
-- Push the tag so the new version will show up in the [releases](https://github.com/TypeStrong/ts-loader/releases): `git push origin --tags`
-- On the releases page, click the "Draft a new release button" and, on the presented page, select the version you've just released, name it and copy in the new markdown that you added to the [changelog](CHANGELOG.md).
-- Now the big moment: `npm publish`
-
-You've released! Pat yourself on the back.
\ No newline at end of file diff --git a/node_modules/ts-loader/LICENSE b/node_modules/ts-loader/LICENSE deleted file mode 100644 index 59f4e79c7..000000000 --- a/node_modules/ts-loader/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT)
-
-Copyright (c) 2015 TypeStrong
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
diff --git a/node_modules/ts-loader/README.md b/node_modules/ts-loader/README.md deleted file mode 100644 index 714f5a93b..000000000 --- a/node_modules/ts-loader/README.md +++ /dev/null @@ -1,303 +0,0 @@ -[](https://travis-ci.org/TypeStrong/ts-loader)
-[](https://ci.appveyor.com/project/JohnReilly/ts-loader/branch/master)
-[](https://npmjs.org/package/ts-loader)
-[](https://gitter.im/TypeStrong/ts-loader)
-
-# TypeScript loader for webpack
-
-[](https://greenkeeper.io/)
-
-This is the typescript loader for webpack.
-
-## Getting Started
-
-Take a look at our [examples](examples/). You can also find some older tutorials and examples [here](https://github.com/TypeStrong/ts-loader/wiki/Tutorials-&-Examples).
-
-### Compatibility
-
-#### TypeScript
-
-ts-loader supports the latest and greatest version of TypeScript right back to v1.6.
-
-A full test suite runs each night (and on each pull request). It runs both on [Linux](https://travis-ci.org/TypeStrong/ts-loader) and [Windows](https://ci.appveyor.com/project/JohnReilly/ts-loader), testing ts-loader against each major release of TypeScript from the latest right back to 1.6. The test suite also runs against TypeScript@next (because we want to use it as much as you do).
-
-If you become aware of issues not caught by the test suite then please let us know. Better yet, write a test and submit it in a PR!
-
-#### Webpack
-
-ts-loader targets webpack 2. It may well still work with webpack 1 but it does not officially support webpack 1 any longer. Our continuous integration test suites run against webpack 2; **not** webpack 1.
-
-#### `LoaderOptionsPlugin`
-
-[There's a known "gotcha"](https://github.com/TypeStrong/ts-loader/issues/283) if you are using webpack 2 with the `LoaderOptionsPlugin`. If you are faced with the `Cannot read property 'unsafeCache' of undefined` error then you probably need to supply a `resolve` object as below: (Thanks @jeffijoe!)
-
- ```js
- new LoaderOptionsPlugin({
- debug: false,
- options: {
- resolve: {
- extensions: ['.ts', '.tsx', '.js']
- }
- }
- })
- ```
-
-It's worth noting that use of the `LoaderOptionsPlugin` is [only supposed to be a stopgap measure](https://webpack.js.org/plugins/loader-options-plugin/). You may want to look at removing it entirely.
-
-### Babel
-
-ts-loader works very well in combination with [babel](https://babeljs.io/) and [babel-loader](https://github.com/babel/babel-loader). To see an example of this in practice take a look at the [example](https://github.com/Microsoft/TypeScriptSamples/tree/master/react-flux-babel-karma) in the official [TypeScript Samples](https://github.com/Microsoft/TypeScriptSamples).
-
-Alternatively take a look at this [webpack 2 example](examples/react-babel-karma-gulp).
-
-### Contributing
-
-This is your TypeScript loader! We want you to help make it even better. Please feel free to contribute; see the [contributor's guide](CONTRIBUTING.md) to get started.
-
-### Installation
-
-```
-npm install ts-loader
-```
-
-You will also need to install TypeScript if you have not already.
-
-```
-npm install typescript
-```
-
-or if you want to install TypeScript globally
-
-```
-npm install typescript -g
-npm link typescript
-```
-
-### Running
-
-Use webpack like normal, including `webpack --watch` and `webpack-dev-server`, or through another
-build system using the [Node.js API](http://webpack.github.io/docs/node.js-api.html).
-
-### Configuration
-
-1. Create or update `webpack.config.js` like so:
-
- ```javascript
- module.exports = {
- entry: './app.ts',
- output: {
- filename: 'bundle.js'
- },
- resolve: {
- // Add `.ts` and `.tsx` as a resolvable extension.
- extensions: ['.ts', '.tsx', '.js'] // note if using webpack 1 you'd also need a '' in the array as well
- },
- module: {
- loaders: [ // loaders will work with webpack 1 or 2; but will be renamed "rules" in future
- // all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
- { test: /\.tsx?$/, loader: 'ts-loader' }
- ]
- }
- }
- ```
-
-2. Add a [`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) file. (The one below is super simple; but you can tweak this to your hearts desire)
-
- ```json
- {
- "compilerOptions": {
- }
- }
- ```
-
-The [tsconfig.json](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) file controls
-TypeScript-related options so that your IDE, the `tsc` command, and this loader all share the
-same options.
-
-### Failing the build on TypeScript compilation error
-
-When the build fails (i.e. at least one typescript compile error occured), ts-loader does **not** propagate the build failure to webpack. The upshot of this is you can fail to notice an erroring build. This is inconvenient; particularly in continuous integration scenarios. If you want to ensure that the build failure is propogated it is advised that you make use of the [webpack-fail-plugin](https://www.npmjs.com/package/webpack-fail-plugin). This plugin that will make the process return status code 1 when it finishes with errors in single-run mode. Et voilร ! Build failure.
-
-For more background have a read of [this issue](https://github.com/TypeStrong/ts-loader/issues/108).
-
-#### Options
-
-There are two types of options: TypeScript options (aka "compiler options") and loader options. TypeScript options should be set using a tsconfig.json file. Loader options can be set either using a query when specifying the loader or through the `options` property in the webpack configuration:
-
-```javascript
-module.exports = {
- ...
- module: {
- rules: [
- {
- test: /\.tsx?$/,
- loader: 'ts-loader',
- options: {
- transpileOnly: true
- }
- }
- ]
- }
-}
-```
-
-Alternatively this can be configured using a query:
-
-```javascript
-module.exports = {
- ...
- module: {
- loaders: [
- // specify option using query
- {
- test: /\.tsx?$/,
- loader: 'ts-loader?' + JSON.stringify({
- transpileOnly: true
- }) }
- ]
- }
-}
-```
-
-For a full breakdown of the power of query syntax have a read of [this](https://github.com/webpack/loader-utils#getoptions).
-
-#### Available Options
-
-##### transpileOnly *(boolean) (default=false)*
-
-If you want to speed up compilation significantly you can set this flag.
-However, many of the benefits you get from static type checking between
-different dependencies in your application will be lost. You should also
-set the `isolatedModules` TypeScript option if you plan to ever make use
-of this.
-
-##### happyPackMode *(boolean) (default=false)*
-
-Enables [`happypack`](https://github.com/amireh/happypack) compatibility mode. This implicitly sets `*transpileOnly*` to `true`. **WARNING!** Some errors will be silently ignored in `happypack` mode (`tsconfig.json` parsing errors, dependency resolution errors, etc.).
-
-##### 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.
-
-##### logLevel *(string) (default=info)*
-
-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).
-
-##### 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.
-
-##### ignoreDiagnostics *(number[]) (default=[])*
-
-You can squelch certain TypeScript errors by specifying an array of diagnostic
-codes to ignore.
-
-##### compiler *(string) (default='typescript')*
-
-Allows use of TypeScript compilers other than the official one. Should be
-set to the NPM name of the compiler, eg [`ntypescript`](https://github.com/basarat/ntypescript).
-
-##### configFileName *(string) (default='tsconfig.json')*
-
-Allows you to specify a custom configuration file.
-
-##### visualStudioErrorFormat *(boolean) (default=false)*
-
-If `true`, the TypeScript compiler output for an error or a warning, e.g. `(3,14): error TS4711: you did something very wrong`, in file `myFile` will instead be `myFile(3,14): error TS4711: you did something very wrong` (notice the file name at the beginning). This way Visual Studio will interpret this line and show any errors or warnings in the *error list*. This enables navigation to the file/line/column through double click.
-
-##### compilerOptions *(object) (default={})*
-
-Allows overriding TypeScript options. Should be specified in the same format
-as you would do for the `compilerOptions` property in tsconfig.json.
-
-##### instance *(string)*
-
-Advanced option to force files to go through different instances of the
-TypeScript compiler. Can be used to force segregation between different parts
-of your code.
-
-#### entryFileIsJs *(boolean) (default=false)*
-
-To be used in concert with the `allowJs` compiler option. If your entry file is JS then you'll need to set this option to true. Please note that this is rather unusual and will generally not be necessary when using `allowJs`.
-
-#### appendTsSuffixTo *(RegExp[]) (default=[])*
-A list of regular expressions to be matched against filename. If filename matches one of the regular expressions, a `.ts` suffix will be appended to that filename.
-
-This is useful for `*.vue` [file format](https://vuejs.org/v2/guide/single-file-components.html) for now. (Probably will benefit from the new single file format in the future.)
-
-Example:
-
-webpack.config.js:
-
-```javascript
-module.exports = {
- entry: './index.vue',
- output: { filename: 'bundle.js' },
- resolve: {
- extensions: ['.ts', '.vue']
- },
- module: {
- rules: [
- { test: /\.vue$/, loader: 'vue-loader' },
- { test: /\.ts$/, loader: 'ts-loader', options: { appendTsSuffixTo: [/\.vue$/] } }
- ]
- }
-}
-```
-
-index.vue
-
-```vue
-<template><p>hello {{msg}}</p></template>
-<script lang="ts">
-export default {
- data(): Object {
- return {
- msg: "world"
- }
- },
-}
-</script>
-```
-
-
-### Loading other resources and code splitting
-
-Loading css and other resources is possible but you will need to make sure that
-you have defined the `require` function in a [declaration file](https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html).
-
-```typescript
-declare var require: {
- <T>(path: string): T;
- (paths: string[], callback: (...modules: any[]) => void): void;
- ensure: (paths: string[], callback: (require: <T>(path: string) => T) => void) => void;
-};
-```
-
-Then you can simply require assets or chunks per the [webpack documentation](http://webpack.github.io/docs).
-
-```js
-require('!style!css!./style.css');
-```
-
-The same basic process is required for code splitting. In this case, you `import` modules you need but you
-don't directly use them. Instead you require them at [split points](http://webpack.github.io/docs/code-splitting.html#defining-a-split-point).
-See [this example](test/comparison-tests/codeSplitting) and [this example](test/comparison-tests/es6codeSplitting) for more details.
-
-### Faster incremental builds
-
-As your project becomes bigger and bigger, compilation time increases linearly. It's because typescript's semantic checker has to inspect all files on every rebuild.
-
-The simple solution is to disable it by `transpileOnly: true` option but it leaves you without type checking.
-
-If you don't want give up type checking, you can use [fork-ts-checker-webpack-plugin](https://github.com/Realytics/fork-ts-checker-webpack-plugin).
-It runs checker on separate process, so your build is as fast as with `transpileOnly: true`. Also, it has several optimizations to make incremental type checking faster (AST cache, multiple workers).
-
-If you'd like to see a simple setup take a look at [our simple example](examples/webpack2-fork-ts-checker/). For a more complex setup take a look at our [more involved example](examples\fork-ts-checker-react-babel-karma-gulp).
-
-## License
-
-MIT License
diff --git a/node_modules/ts-loader/UPGRADE.md b/node_modules/ts-loader/UPGRADE.md deleted file mode 100644 index 5dcc11c80..000000000 --- a/node_modules/ts-loader/UPGRADE.md +++ /dev/null @@ -1,56 +0,0 @@ -# Upgrade Guide
-
-## v1.x.x to 2.0.x
-
-We no longer support Node 0.12 or webpack 1. Please use Node 4+ and webpack 2.
-
-## v0.9.x to 1.0.x
-
-We no longer support Node 0.12 officially since it is being end-of-lifed.
-That said, ts-loader will probably still work with it at present.
-(Though you shouldn't depend on it and ought to upgrade your version of node).
-Otherwise there are no breaking changes known of; if you find any then let us know!
-
-## v0.8.x to 0.9.x
-
-No breaking changes known of; if there are then let us know!
-
-## v0.7.x to 0.8.x
-
-This release has two breaking changes:
-
-1. If you are using TypeScript 1.7+ and specify `target: es6` and
-`module: commonjs`, the output will now be CommonJS instead of ES6
-modules. This brings ts-loader into alignment with `tsc`.
-2. Declaration files are now emitted when `declaration: true` is
-specified in the tsconfig.json.
-
-## v0.6.x to 0.7.x
-
-This release changed loader messages to print on stderr instead of
-stdout. While this shouldn't affect most, if for some reason you relied
-on messages going to stdout or on messages *not* going to stderr you
-may need to make a change.
-
-## v0.5.x to v0.6.x
-
-This release removed support for TypeScript 1.5 and adds preliminary
-support for TypeScript 1.7. Please upgrade to the stable release of
-TypeScript 1.6 or above.
-
-## v0.4.x to v0.5.x
-
-This release removed the dependency on TypeScript from the loader. This
-was done so that it's very easy to use the nightly version of TypeScript
-by installing `typescript@next`. This does mean that you are responsible
-for installing TypeScript yourself.
-
-## v0.3.x to v0.4.x
-
-This release added support for TypeScript 1.5. One of the major changes
-introduced in TypeScript 1.5 is the
-[tsconfig.json](https://github.com/Microsoft/TypeScript/wiki/tsconfig.json)
-file. All of the TypeScript options that were previously defined through
-the loader querystring (`module`, `target`, etc) should now be specified
-in the tsconfig.json file instead. The querystring options have been
-removed.
\ No newline at end of file diff --git a/node_modules/ts-loader/appveyor.yml b/node_modules/ts-loader/appveyor.yml deleted file mode 100644 index 82b424026..000000000 --- a/node_modules/ts-loader/appveyor.yml +++ /dev/null @@ -1,21 +0,0 @@ -environment:
- nodejs_version: "6"
- matrix:
- - TYPESCRIPT: typescript@1.6.2
- - TYPESCRIPT: typescript@1.7.5
- - TYPESCRIPT: typescript@1.8.2
- - TYPESCRIPT: typescript@2.0.9
- - TYPESCRIPT: typescript@2.1.5
- - TYPESCRIPT: typescript@2.2.1
- - TYPESCRIPT: typescript@2.3.1
- - TYPESCRIPT: typescript@next
-install:
- - ps: Install-Product node $env:nodejs_version
- - npm install
- - npm run build
- - npm install %TYPESCRIPT%
-test_script:
- - node --version
- - npm --version
- - npm test
-build: off
diff --git a/node_modules/ts-loader/dist/after-compile.js b/node_modules/ts-loader/dist/after-compile.js deleted file mode 100644 index 7c8cb7ef8..000000000 --- a/node_modules/ts-loader/dist/after-compile.js +++ /dev/null @@ -1,147 +0,0 @@ -"use strict"; -var path = require("path"); -var utils = require("./utils"); -var constants = require("./constants"); -function makeAfterCompile(instance, configFilePath) { - var getCompilerOptionDiagnostics = true; - var checkAllFilesForErrors = true; - return function (compilation, callback) { - // Don't add errors for child compilations - if (compilation.compiler.isChild()) { - callback(); - return; - } - removeTSLoaderErrors(compilation.errors); - provideCompilerOptionDiagnosticErrorsToWebpack(getCompilerOptionDiagnostics, compilation, instance, configFilePath); - getCompilerOptionDiagnostics = false; - var modules = determineModules(compilation); - var filesToCheckForErrors = determineFilesToCheckForErrors(checkAllFilesForErrors, instance); - checkAllFilesForErrors = false; - var filesWithErrors = {}; - provideErrorsToWebpack(filesToCheckForErrors, filesWithErrors, compilation, modules, instance); - provideDeclarationFilesToWebpack(filesToCheckForErrors, instance.languageService, compilation); - instance.filesWithErrors = filesWithErrors; - instance.modifiedFiles = null; - callback(); - }; -} -/** - * handle compiler option errors after the first compile - */ -function provideCompilerOptionDiagnosticErrorsToWebpack(getCompilerOptionDiagnostics, compilation, instance, configFilePath) { - if (getCompilerOptionDiagnostics) { - var languageService = instance.languageService, loaderOptions = instance.loaderOptions, compiler = instance.compiler; - utils.registerWebpackErrors(compilation.errors, utils.formatErrors(languageService.getCompilerOptionsDiagnostics(), loaderOptions, compiler, { file: configFilePath || 'tsconfig.json' })); - } -} -/** - * build map of all modules based on normalized filename - * this is used for quick-lookup when trying to find modules - * based on filepath - */ -function determineModules(compilation) { - var modules = {}; - compilation.modules.forEach(function (module) { - if (module.resource) { - var modulePath = path.normalize(module.resource); - if (utils.hasOwnProperty(modules, modulePath)) { - var existingModules = modules[modulePath]; - if (existingModules.indexOf(module) === -1) { - existingModules.push(module); - } - } - else { - modules[modulePath] = [module]; - } - } - }); - return modules; -} -function determineFilesToCheckForErrors(checkAllFilesForErrors, instance) { - var files = instance.files, modifiedFiles = instance.modifiedFiles, filesWithErrors = instance.filesWithErrors; - // calculate array of files to check - var filesToCheckForErrors = {}; - if (checkAllFilesForErrors) { - // check all files on initial run - filesToCheckForErrors = files; - } - else if (modifiedFiles) { - // check all modified files, and all dependants - Object.keys(modifiedFiles).forEach(function (modifiedFileName) { - utils.collectAllDependants(instance.reverseDependencyGraph, modifiedFileName) - .forEach(function (fileName) { - filesToCheckForErrors[fileName] = files[fileName]; - }); - }); - } - // re-check files with errors from previous build - if (filesWithErrors) { - Object.keys(filesWithErrors).forEach(function (fileWithErrorName) { - return filesToCheckForErrors[fileWithErrorName] = filesWithErrors[fileWithErrorName]; - }); - } - return filesToCheckForErrors; -} -function provideErrorsToWebpack(filesToCheckForErrors, filesWithErrors, compilation, modules, instance) { - var compiler = instance.compiler, languageService = instance.languageService, files = instance.files, loaderOptions = instance.loaderOptions; - Object.keys(filesToCheckForErrors) - .filter(function (filePath) { return !!filePath.match(constants.dtsTsTsxRegex); }) - .forEach(function (filePath) { - var errors = languageService.getSyntacticDiagnostics(filePath).concat(languageService.getSemanticDiagnostics(filePath)); - if (errors.length > 0) { - filesWithErrors[filePath] = files[filePath]; - } - // if we have access to a webpack module, use that - if (utils.hasOwnProperty(modules, filePath)) { - var associatedModules = modules[filePath]; - associatedModules.forEach(function (module) { - // remove any existing errors - removeTSLoaderErrors(module.errors); - // append errors - var formattedErrors = utils.formatErrors(errors, loaderOptions, compiler, { module: module }); - utils.registerWebpackErrors(module.errors, formattedErrors); - utils.registerWebpackErrors(compilation.errors, formattedErrors); - }); - } - else { - // otherwise it's a more generic error - utils.registerWebpackErrors(compilation.errors, utils.formatErrors(errors, loaderOptions, compiler, { file: filePath })); - } - }); -} -/** - * gather all declaration files from TypeScript and output them to webpack - */ -function provideDeclarationFilesToWebpack(filesToCheckForErrors, languageService, compilation) { - Object.keys(filesToCheckForErrors) - .filter(function (filePath) { return !!filePath.match(constants.tsTsxRegex); }) - .forEach(function (filePath) { - var output = languageService.getEmitOutput(filePath); - var declarationFile = output.outputFiles.filter(function (outputFile) { return !!outputFile.name.match(constants.dtsDtsxRegex); }).pop(); - if (declarationFile) { - var assetPath = path.relative(compilation.compiler.context, declarationFile.name); - compilation.assets[assetPath] = { - source: function () { return declarationFile.text; }, - size: function () { return declarationFile.text.length; }, - }; - } - }); -} -/** - * handle all other errors. The basic approach here to get accurate error - * reporting is to start with a "blank slate" each compilation and gather - * all errors from all files. Since webpack tracks errors in a module from - * compilation-to-compilation, and since not every module always runs through - * the loader, we need to detect and remove any pre-existing errors. - */ -function removeTSLoaderErrors(errors) { - var index = -1; - var length = errors.length; - while (++index < length) { - if (errors[index].loaderSource === 'ts-loader') { - errors.splice(index--, 1); - length--; - } - } -} -module.exports = makeAfterCompile; diff --git a/node_modules/ts-loader/dist/compilerSetup.js b/node_modules/ts-loader/dist/compilerSetup.js deleted file mode 100644 index 6b456f100..000000000 --- a/node_modules/ts-loader/dist/compilerSetup.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var semver = require('semver'); -var constants = require("./constants"); -function getCompiler(loaderOptions, log) { - var compiler; - var errorMessage; - var compilerDetailsLogMessage; - var compilerCompatible = false; - try { - compiler = require(loaderOptions.compiler); - } - catch (e) { - errorMessage = loaderOptions.compiler === 'typescript' - ? 'Could not load TypeScript. Try installing with `npm install typescript`. If TypeScript is installed globally, try using `npm link typescript`.' - : "Could not load TypeScript compiler with NPM package name `" + loaderOptions.compiler + "`. Are you sure it is correctly installed?"; - } - if (!errorMessage) { - compilerDetailsLogMessage = "ts-loader: Using " + loaderOptions.compiler + "@" + compiler.version; - compilerCompatible = false; - if (loaderOptions.compiler === 'typescript') { - if (compiler.version && semver.gte(compiler.version, '1.6.2-0')) { - // don't log yet in this case, if a tsconfig.json exists we want to combine the message - compilerCompatible = true; - } - else { - log.logError((compilerDetailsLogMessage + ". This version is incompatible with ts-loader. Please upgrade to the latest version of TypeScript.").red); - } - } - else { - log.logWarning((compilerDetailsLogMessage + ". This version may or may not be compatible with ts-loader.").yellow); - } - } - return { compiler: compiler, compilerCompatible: compilerCompatible, compilerDetailsLogMessage: compilerDetailsLogMessage, errorMessage: errorMessage }; -} -exports.getCompiler = getCompiler; -function getCompilerOptions(compilerCompatible, compiler, configParseResult) { - var compilerOptions = Object.assign({}, configParseResult.options, { - skipDefaultLibCheck: true, - suppressOutputPathCheck: true, - }); - // if `module` is not specified and not using ES6 target, default to CJS module output - if ((!compilerOptions.module) && compilerOptions.target !== constants.ScriptTargetES2015) { - compilerOptions.module = constants.ModuleKindCommonJs; - } - else if (compilerCompatible && semver.lt(compiler.version, '1.7.3-0') && compilerOptions.target === constants.ScriptTargetES2015) { - // special handling for TS 1.6 and target: es6 - compilerOptions.module = constants.ModuleKindNone; - } - return compilerOptions; -} -exports.getCompilerOptions = getCompilerOptions; diff --git a/node_modules/ts-loader/dist/config.js b/node_modules/ts-loader/dist/config.js deleted file mode 100644 index 9c74f89ba..000000000 --- a/node_modules/ts-loader/dist/config.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var path = require("path"); -var utils = require("./utils"); -function getConfigFile(compiler, loader, loaderOptions, compilerCompatible, log, compilerDetailsLogMessage) { - var configFilePath = findConfigFile(compiler, path.dirname(loader.resourcePath), loaderOptions.configFileName); - var configFileError; - var configFile; - if (configFilePath) { - if (compilerCompatible) { - log.logInfo((compilerDetailsLogMessage + " and " + configFilePath).green); - } - else { - log.logInfo(("ts-loader: Using config file at " + configFilePath).green); - } - // HACK: relies on the fact that passing an extra argument won't break - // the old API that has a single parameter - configFile = compiler.readConfigFile(configFilePath, compiler.sys.readFile); - if (configFile.error) { - configFileError = utils.formatErrors([configFile.error], loaderOptions, compiler, { file: configFilePath })[0]; - } - } - else { - if (compilerCompatible) { - log.logInfo(compilerDetailsLogMessage.green); - } - configFile = { - config: { - compilerOptions: {}, - files: [], - }, - }; - } - if (!configFileError) { - configFile.config.compilerOptions = Object.assign({}, configFile.config.compilerOptions, loaderOptions.compilerOptions); - // do any necessary config massaging - if (loaderOptions.transpileOnly) { - configFile.config.compilerOptions.isolatedModules = true; - } - } - return { - configFilePath: configFilePath, - configFile: configFile, - configFileError: configFileError - }; -} -exports.getConfigFile = getConfigFile; -/** - * The tsconfig.json is found using the same method as `tsc`, starting in the current directory - * and continuing up the parent directory chain. - */ -function findConfigFile(compiler, searchPath, configFileName) { - while (true) { - var fileName = path.join(searchPath, configFileName); - if (compiler.sys.fileExists(fileName)) { - return fileName; - } - var parentPath = path.dirname(searchPath); - if (parentPath === searchPath) { - break; - } - searchPath = parentPath; - } - return undefined; -} -function getConfigParseResult(compiler, configFile, configFilePath) { - var configParseResult; - if (typeof compiler.parseJsonConfigFileContent === 'function') { - // parseConfigFile was renamed between 1.6.2 and 1.7 - configParseResult = compiler.parseJsonConfigFileContent(configFile.config, compiler.sys, path.dirname(configFilePath || '')); - } - else { - configParseResult = compiler.parseConfigFile(configFile.config, compiler.sys, path.dirname(configFilePath || '')); - } - return configParseResult; -} -exports.getConfigParseResult = getConfigParseResult; diff --git a/node_modules/ts-loader/dist/constants.js b/node_modules/ts-loader/dist/constants.js deleted file mode 100644 index e97cf0e4c..000000000 --- a/node_modules/ts-loader/dist/constants.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var os = require("os"); -exports.EOL = os.EOL; -exports.CarriageReturnLineFeed = '\r\n'; -exports.LineFeed = '\n'; -exports.CarriageReturnLineFeedCode = 0; -exports.LineFeedCode = 1; -exports.ScriptTargetES2015 = 2; -exports.ModuleKindNone = 0; -exports.ModuleKindCommonJs = 1; -exports.tsTsxRegex = /\.ts(x?)$/i; -exports.dtsDtsxRegex = /\.d\.ts(x?)$/i; -exports.dtsTsTsxRegex = /(\.d)?\.ts(x?)$/i; -exports.tsTsxJsJsxRegex = /\.tsx?$|\.jsx?$/i; -exports.jsJsx = /\.js(x?)$/i; -exports.jsJsxMap = /\.js(x?)\.map$/i; diff --git a/node_modules/ts-loader/dist/index.js b/node_modules/ts-loader/dist/index.js deleted file mode 100644 index 7a1e59041..000000000 --- a/node_modules/ts-loader/dist/index.js +++ /dev/null @@ -1,164 +0,0 @@ -"use strict"; -var path = require("path"); -var loaderUtils = require("loader-utils"); -require('colors'); -var instances = require("./instances"); -var utils = require("./utils"); -var constants = require("./constants"); -var webpackInstances = []; -var loaderOptionsCache = {}; -/** - * The entry point for ts-loader - */ -function loader(contents) { - this.cacheable && this.cacheable(); - var callback = this.async(); - var options = getLoaderOptions(this); - var _a = instances.getTypeScriptInstance(options, this), instance = _a.instance, error = _a.error; - if (error) { - callback(error); - return; - } - var rawFilePath = path.normalize(this.resourcePath); - var filePath = utils.appendTsSuffixIfMatch(options.appendTsSuffixTo, rawFilePath); - var fileVersion = updateFileInCache(filePath, contents, instance); - var _b = options.transpileOnly - ? getTranspilationEmit(filePath, contents, instance, this) - : getEmit(rawFilePath, filePath, instance, this), outputText = _b.outputText, sourceMapText = _b.sourceMapText; - if (outputText === null || outputText === undefined) { - var additionalGuidance = filePath.indexOf('node_modules') !== -1 - ? "\nYou should not need to recompile .ts files in node_modules.\nPlease contact the package author to advise them to use --declaration --outDir.\nMore https://github.com/Microsoft/TypeScript/issues/12358" - : ""; - throw new Error("Typescript emitted no output for " + filePath + "." + additionalGuidance); - } - var _c = makeSourceMap(sourceMapText, outputText, filePath, contents, this), sourceMap = _c.sourceMap, output = _c.output; - // _module.meta is not available inside happypack - if (!options.happyPackMode) { - // Make sure webpack is aware that even though the emitted JavaScript may be the same as - // a previously cached version the TypeScript may be different and therefore should be - // treated as new - this._module.meta.tsLoaderFileVersion = fileVersion; - } - callback(null, output, sourceMap); -} -/** - * either retrieves loader options from the cache - * or creates them, adds them to the cache and returns - */ -function getLoaderOptions(loader) { - // differentiate the TypeScript instance based on the webpack instance - var webpackIndex = webpackInstances.indexOf(loader._compiler); - if (webpackIndex === -1) { - webpackIndex = webpackInstances.push(loader._compiler) - 1; - } - var queryOptions = loaderUtils.getOptions(loader) || {}; - var configFileOptions = loader.options.ts || {}; - var instanceName = webpackIndex + '_' + (queryOptions.instance || configFileOptions.instance || 'default'); - if (utils.hasOwnProperty(loaderOptionsCache, instanceName)) { - return loaderOptionsCache[instanceName]; - } - var options = Object.assign({}, { - silent: false, - logLevel: 'INFO', - logInfoToStdOut: false, - compiler: 'typescript', - configFileName: 'tsconfig.json', - transpileOnly: false, - visualStudioErrorFormat: false, - compilerOptions: {}, - appendTsSuffixTo: [], - entryFileIsJs: false, - happyPackMode: false, - }, configFileOptions, queryOptions); - options.ignoreDiagnostics = utils.arrify(options.ignoreDiagnostics).map(Number); - options.logLevel = options.logLevel.toUpperCase(); - options.instance = instanceName; - // happypack can be used only together with transpileOnly mode - options.transpileOnly = options.happyPackMode ? true : options.transpileOnly; - loaderOptionsCache[instanceName] = options; - return options; -} -/** - * Either add file to the overall files cache or update it in the cache when the file contents have changed - * Also add the file to the modified files - */ -function updateFileInCache(filePath, contents, instance) { - // Update file contents - var file = instance.files[filePath]; - if (!file) { - file = instance.files[filePath] = { version: 0 }; - } - if (file.text !== contents) { - file.version++; - file.text = contents; - instance.version++; - } - // push this file to modified files hash. - if (!instance.modifiedFiles) { - instance.modifiedFiles = {}; - } - instance.modifiedFiles[filePath] = file; - return file.version; -} -function getEmit(rawFilePath, filePath, instance, loader) { - // Emit Javascript - var output = instance.languageService.getEmitOutput(filePath); - loader.clearDependencies(); - loader.addDependency(rawFilePath); - var allDefinitionFiles = Object.keys(instance.files).filter(function (defFilePath) { return !!defFilePath.match(constants.dtsDtsxRegex); }); - // Make this file dependent on *all* definition files in the program - var addDependency = loader.addDependency.bind(loader); - allDefinitionFiles.forEach(addDependency); - /* - alternative approach to the below which is more correct but has a heavy performance cost - see https://github.com/TypeStrong/ts-loader/issues/393 - with this approach constEnumReExportWatch test will pass; without it, not. - - // Additionally make this file dependent on all imported files as well - // as any deeper recursive dependencies - const additionalDependencies = utils.collectAllDependencies(instance.dependencyGraph, filePath); - */ - // Additionally make this file dependent on all imported files - var additionalDependencies = instance.dependencyGraph[filePath] - && instance.dependencyGraph[filePath].map(function (module) { return module.originalFileName; }); - if (additionalDependencies) { - additionalDependencies.forEach(addDependency); - } - loader._module.meta.tsLoaderDefinitionFileVersions = allDefinitionFiles - .concat(additionalDependencies) - .map(function (defFilePath) { return defFilePath + '@' + (instance.files[defFilePath] || { version: '?' }).version; }); - var outputFile = output.outputFiles.filter(function (outputFile) { return !!outputFile.name.match(constants.jsJsx); }).pop(); - var outputText = (outputFile) ? outputFile.text : undefined; - var sourceMapFile = output.outputFiles.filter(function (outputFile) { return !!outputFile.name.match(constants.jsJsxMap); }).pop(); - var sourceMapText = (sourceMapFile) ? sourceMapFile.text : undefined; - return { outputText: outputText, sourceMapText: sourceMapText }; -} -/** - * Transpile file - */ -function getTranspilationEmit(filePath, contents, instance, loader) { - var fileName = path.basename(filePath); - var _a = instance.compiler.transpileModule(contents, { - compilerOptions: instance.compilerOptions, - reportDiagnostics: true, - fileName: fileName, - }), outputText = _a.outputText, sourceMapText = _a.sourceMapText, diagnostics = _a.diagnostics; - // _module.errors is not available inside happypack - see https://github.com/TypeStrong/ts-loader/issues/336 - if (!instance.loaderOptions.happyPackMode) { - utils.registerWebpackErrors(loader._module.errors, utils.formatErrors(diagnostics, instance.loaderOptions, instance.compiler, { module: loader._module })); - } - return { outputText: outputText, sourceMapText: sourceMapText }; -} -function makeSourceMap(sourceMapText, outputText, filePath, contents, loader) { - if (!sourceMapText) { - return { output: outputText, sourceMap: undefined }; - } - return { - output: outputText.replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, ''), - sourceMap: Object.assign(JSON.parse(sourceMapText), { - sources: [loaderUtils.getRemainingRequest(loader)], - file: filePath, - sourcesContent: [contents] - }) - }; -} -module.exports = loader; diff --git a/node_modules/ts-loader/dist/instances.js b/node_modules/ts-loader/dist/instances.js deleted file mode 100644 index 10227547a..000000000 --- a/node_modules/ts-loader/dist/instances.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var path = require("path"); -var fs = require("fs"); -require('colors'); -var afterCompile = require("./after-compile"); -var config = require("./config"); -var compilerSetup = require("./compilerSetup"); -var utils = require("./utils"); -var logger = require("./logger"); -var makeServicesHost = require("./servicesHost"); -var watchRun = require("./watch-run"); -var instances = {}; -/** - * The loader is executed once for each file seen by webpack. However, we need to keep - * a persistent instance of TypeScript that contains all of the files in the program - * along with definition files and options. This function either creates an instance - * or returns the existing one. Multiple instances are possible by using the - * `instance` property. - */ -function getTypeScriptInstance(loaderOptions, loader) { - if (utils.hasOwnProperty(instances, loaderOptions.instance)) { - return { instance: instances[loaderOptions.instance] }; - } - var log = logger.makeLogger(loaderOptions); - var _a = compilerSetup.getCompiler(loaderOptions, log), compiler = _a.compiler, compilerCompatible = _a.compilerCompatible, compilerDetailsLogMessage = _a.compilerDetailsLogMessage, errorMessage = _a.errorMessage; - if (errorMessage) { - return { error: utils.makeError({ rawMessage: errorMessage }) }; - } - var _b = config.getConfigFile(compiler, loader, loaderOptions, compilerCompatible, log, compilerDetailsLogMessage), configFilePath = _b.configFilePath, configFile = _b.configFile, configFileError = _b.configFileError; - if (configFileError) { - return { error: configFileError }; - } - var configParseResult = config.getConfigParseResult(compiler, configFile, configFilePath); - if (configParseResult.errors.length && !loaderOptions.happyPackMode) { - utils.registerWebpackErrors(loader._module.errors, utils.formatErrors(configParseResult.errors, loaderOptions, compiler, { file: configFilePath })); - return { error: utils.makeError({ rawMessage: 'error while parsing tsconfig.json', file: configFilePath }) }; - } - var compilerOptions = compilerSetup.getCompilerOptions(compilerCompatible, compiler, configParseResult); - var files = {}; - if (loaderOptions.transpileOnly) { - // quick return for transpiling - // we do need to check for any issues with TS options though - var program = compiler.createProgram([], compilerOptions); - var diagnostics = program.getOptionsDiagnostics(); - // happypack does not have _module.errors - see https://github.com/TypeStrong/ts-loader/issues/336 - if (!loaderOptions.happyPackMode) { - utils.registerWebpackErrors(loader._module.errors, utils.formatErrors(diagnostics, loaderOptions, compiler, { file: configFilePath || 'tsconfig.json' })); - } - return { instance: instances[loaderOptions.instance] = { compiler: compiler, compilerOptions: compilerOptions, loaderOptions: loaderOptions, files: files, dependencyGraph: {}, reverseDependencyGraph: {} } }; - } - // Load initial files (core lib files, any files specified in tsconfig.json) - var normalizedFilePath; - try { - var filesToLoad = configParseResult.fileNames; - filesToLoad.forEach(function (filePath) { - normalizedFilePath = path.normalize(filePath); - files[normalizedFilePath] = { - text: fs.readFileSync(normalizedFilePath, 'utf-8'), - version: 0 - }; - }); - } - catch (exc) { - return { error: utils.makeError({ - rawMessage: "A file specified in tsconfig.json could not be found: " + normalizedFilePath - }) }; - } - // if allowJs is set then we should accept js(x) files - var scriptRegex = configParseResult.options.allowJs && loaderOptions.entryFileIsJs - ? /\.tsx?$|\.jsx?$/i - : /\.tsx?$/i; - var instance = instances[loaderOptions.instance] = { - compiler: compiler, - compilerOptions: compilerOptions, - loaderOptions: loaderOptions, - files: files, - languageService: null, - version: 0, - dependencyGraph: {}, - reverseDependencyGraph: {}, - modifiedFiles: null, - }; - var servicesHost = makeServicesHost(scriptRegex, log, loader, instance, loaderOptions.appendTsSuffixTo); - instance.languageService = compiler.createLanguageService(servicesHost, compiler.createDocumentRegistry()); - loader._compiler.plugin("after-compile", afterCompile(instance, configFilePath)); - loader._compiler.plugin("watch-run", watchRun(instance)); - return { instance: instance }; -} -exports.getTypeScriptInstance = getTypeScriptInstance; diff --git a/node_modules/ts-loader/dist/interfaces.js b/node_modules/ts-loader/dist/interfaces.js deleted file mode 100644 index c8ad2e549..000000000 --- a/node_modules/ts-loader/dist/interfaces.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/ts-loader/dist/logger.js b/node_modules/ts-loader/dist/logger.js deleted file mode 100644 index 821e4f9ba..000000000 --- a/node_modules/ts-loader/dist/logger.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var Console = require('console').Console; -var stderrConsole = new Console(process.stderr); -var stdoutConsole = new Console(process.stdout); -var LogLevel; -(function (LogLevel) { - LogLevel[LogLevel["INFO"] = 1] = "INFO"; - LogLevel[LogLevel["WARN"] = 2] = "WARN"; - LogLevel[LogLevel["ERROR"] = 3] = "ERROR"; -})(LogLevel || (LogLevel = {})); -var doNothingLogger = function () { - var _messages = []; - for (var _i = 0; _i < arguments.length; _i++) { - _messages[_i] = arguments[_i]; - } -}; -function makeLoggerFunc(loaderOptions) { - return loaderOptions.silent - ? function (_whereToLog, _messages) { } - : function (whereToLog, messages) { return console.log.apply(whereToLog, messages); }; -} -function makeExternalLogger(loaderOptions, logger) { - var output = loaderOptions.logInfoToStdOut ? stdoutConsole : stderrConsole; - return function () { - var messages = []; - for (var _i = 0; _i < arguments.length; _i++) { - messages[_i] = arguments[_i]; - } - return logger(output, messages); - }; -} -function makeLogInfo(loaderOptions, logger) { - return LogLevel[loaderOptions.logLevel] <= LogLevel.INFO - ? function () { - var messages = []; - for (var _i = 0; _i < arguments.length; _i++) { - messages[_i] = arguments[_i]; - } - return logger(loaderOptions.logInfoToStdOut ? stdoutConsole : stderrConsole, messages); - } - : doNothingLogger; -} -function makeLogError(loaderOptions, logger) { - return LogLevel[loaderOptions.logLevel] <= LogLevel.ERROR - ? function () { - var messages = []; - for (var _i = 0; _i < arguments.length; _i++) { - messages[_i] = arguments[_i]; - } - return logger(stderrConsole, messages); - } - : doNothingLogger; -} -function makeLogWarning(loaderOptions, logger) { - return LogLevel[loaderOptions.logLevel] <= LogLevel.WARN - ? function () { - var messages = []; - for (var _i = 0; _i < arguments.length; _i++) { - messages[_i] = arguments[_i]; - } - return logger(stderrConsole, messages); - } - : doNothingLogger; -} -function makeLogger(loaderOptions) { - var logger = makeLoggerFunc(loaderOptions); - return { - log: makeExternalLogger(loaderOptions, logger), - logInfo: makeLogInfo(loaderOptions, logger), - logWarning: makeLogWarning(loaderOptions, logger), - logError: makeLogError(loaderOptions, logger) - }; -} -exports.makeLogger = makeLogger; diff --git a/node_modules/ts-loader/dist/resolver.js b/node_modules/ts-loader/dist/resolver.js deleted file mode 100644 index 8680bff1e..000000000 --- a/node_modules/ts-loader/dist/resolver.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -var node = require("enhanced-resolve/lib/node"); -function makeResolver(options) { - return node.create.sync(options.resolve); -} -module.exports = makeResolver; diff --git a/node_modules/ts-loader/dist/servicesHost.js b/node_modules/ts-loader/dist/servicesHost.js deleted file mode 100644 index 2029801c2..000000000 --- a/node_modules/ts-loader/dist/servicesHost.js +++ /dev/null @@ -1,108 +0,0 @@ -"use strict"; -var constants = require("./constants"); -var path = require("path"); -var makeResolver = require("./resolver"); -var utils = require("./utils"); -/** - * Create the TypeScript language service - */ -function makeServicesHost(scriptRegex, log, loader, instance, appendTsSuffixTo) { - var compiler = instance.compiler, compilerOptions = instance.compilerOptions, files = instance.files; - var newLine = compilerOptions.newLine === constants.CarriageReturnLineFeedCode ? constants.CarriageReturnLineFeed : - compilerOptions.newLine === constants.LineFeedCode ? constants.LineFeed : - constants.EOL; - // make a (sync) resolver that follows webpack's rules - var resolveSync = makeResolver(loader.options); - var moduleResolutionHost = { - fileExists: function (fileName) { return utils.readFile(fileName) !== undefined; }, - readFile: function (fileName) { return utils.readFile(fileName); }, - }; - return { - getProjectVersion: function () { return "" + instance.version; }, - getScriptFileNames: function () { return Object.keys(files).filter(function (filePath) { return !!filePath.match(scriptRegex); }); }, - getScriptVersion: function (fileName) { - fileName = path.normalize(fileName); - return files[fileName] && files[fileName].version.toString(); - }, - getScriptSnapshot: function (fileName) { - // This is called any time TypeScript needs a file's text - // We either load from memory or from disk - fileName = path.normalize(fileName); - var file = files[fileName]; - if (!file) { - var text = utils.readFile(fileName); - if (!text) { - return undefined; - } - file = files[fileName] = { version: 0, text: text }; - } - return compiler.ScriptSnapshot.fromString(file.text); - }, - /** - * getDirectories is also required for full import and type reference completions. - * Without it defined, certain completions will not be provided - */ - getDirectories: compiler.sys ? compiler.sys.getDirectories : undefined, - /** - * For @types expansion, these two functions are needed. - */ - directoryExists: compiler.sys ? compiler.sys.directoryExists : undefined, - getCurrentDirectory: function () { return process.cwd(); }, - getCompilationSettings: function () { return compilerOptions; }, - getDefaultLibFileName: function (options) { return compiler.getDefaultLibFilePath(options); }, - getNewLine: function () { return newLine; }, - log: log.log, - resolveModuleNames: function (moduleNames, containingFile) { - return resolveModuleNames(resolveSync, moduleResolutionHost, appendTsSuffixTo, scriptRegex, instance, moduleNames, containingFile); - } - }; -} -function resolveModuleNames(resolveSync, moduleResolutionHost, appendTsSuffixTo, scriptRegex, instance, moduleNames, containingFile) { - var resolvedModules = moduleNames.map(function (moduleName) { - return resolveModuleName(resolveSync, moduleResolutionHost, appendTsSuffixTo, scriptRegex, instance, moduleName, containingFile); - }); - populateDependencyGraphs(resolvedModules, instance, containingFile); - return resolvedModules; -} -function resolveModuleName(resolveSync, moduleResolutionHost, appendTsSuffixTo, scriptRegex, instance, moduleName, containingFile) { - var compiler = instance.compiler, compilerOptions = instance.compilerOptions; - var resolutionResult; - try { - var originalFileName = resolveSync(undefined, path.normalize(path.dirname(containingFile)), moduleName); - var resolvedFileName = utils.appendTsSuffixIfMatch(appendTsSuffixTo, originalFileName); - if (resolvedFileName.match(scriptRegex)) { - resolutionResult = { resolvedFileName: resolvedFileName, originalFileName: originalFileName }; - } - } - catch (e) { } - var tsResolution = compiler.resolveModuleName(moduleName, containingFile, compilerOptions, moduleResolutionHost); - if (tsResolution.resolvedModule) { - var resolvedFileName = path.normalize(tsResolution.resolvedModule.resolvedFileName); - var tsResolutionResult = { - originalFileName: resolvedFileName, - resolvedFileName: resolvedFileName, - isExternalLibraryImport: tsResolution.resolvedModule.isExternalLibraryImport - }; - if (resolutionResult) { - if (resolutionResult.resolvedFileName === tsResolutionResult.resolvedFileName) { - resolutionResult.isExternalLibraryImport = tsResolutionResult.isExternalLibraryImport; - } - } - else { - resolutionResult = tsResolutionResult; - } - } - return resolutionResult; -} -function populateDependencyGraphs(resolvedModules, instance, containingFile) { - resolvedModules = resolvedModules - .filter(function (m) { return m !== null && m !== undefined; }); - instance.dependencyGraph[path.normalize(containingFile)] = resolvedModules; - resolvedModules.forEach(function (resolvedModule) { - if (!instance.reverseDependencyGraph[resolvedModule.resolvedFileName]) { - instance.reverseDependencyGraph[resolvedModule.resolvedFileName] = {}; - } - instance.reverseDependencyGraph[resolvedModule.resolvedFileName][path.normalize(containingFile)] = true; - }); -} -module.exports = makeServicesHost; diff --git a/node_modules/ts-loader/dist/utils.js b/node_modules/ts-loader/dist/utils.js deleted file mode 100644 index 30292d942..000000000 --- a/node_modules/ts-loader/dist/utils.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var path = require("path"); -var fs = require("fs"); -var constants = require("./constants"); -function registerWebpackErrors(existingErrors, errorsToPush) { - Array.prototype.splice.apply(existingErrors, [0, 0].concat(errorsToPush)); -} -exports.registerWebpackErrors = registerWebpackErrors; -function hasOwnProperty(obj, property) { - return Object.prototype.hasOwnProperty.call(obj, property); -} -exports.hasOwnProperty = hasOwnProperty; -/** - * Take TypeScript errors, parse them and format to webpack errors - * Optionally adds a file name - */ -function formatErrors(diagnostics, loaderOptions, compiler, merge) { - return diagnostics - .filter(function (diagnostic) { return loaderOptions.ignoreDiagnostics.indexOf(diagnostic.code) === -1; }) - .map(function (diagnostic) { - var errorCategory = compiler.DiagnosticCategory[diagnostic.category].toLowerCase(); - var errorCategoryAndCode = errorCategory + ' TS' + diagnostic.code + ': '; - var messageText = errorCategoryAndCode + compiler.flattenDiagnosticMessageText(diagnostic.messageText, constants.EOL); - var error; - if (diagnostic.file) { - var lineChar = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); - var errorMessage = "" + '('.white + (lineChar.line + 1).toString().cyan + "," + (lineChar.character + 1).toString().cyan + "): " + messageText.red; - if (loaderOptions.visualStudioErrorFormat) { - errorMessage = path.normalize(diagnostic.file.fileName).red + errorMessage; - } - error = makeError({ - message: errorMessage, - rawMessage: messageText, - location: { line: lineChar.line + 1, character: lineChar.character + 1 } - }); - } - else { - error = makeError({ rawMessage: messageText }); - } - return Object.assign(error, merge); - }); -} -exports.formatErrors = formatErrors; -function readFile(fileName) { - fileName = path.normalize(fileName); - try { - return fs.readFileSync(fileName, 'utf8'); - } - catch (e) { - return undefined; - } -} -exports.readFile = readFile; -function makeError(_a) { - var rawMessage = _a.rawMessage, message = _a.message, location = _a.location, file = _a.file; - var error = { - rawMessage: rawMessage, - message: message || "" + rawMessage.red, - loaderSource: 'ts-loader' - }; - return Object.assign(error, { location: location, file: file }); -} -exports.makeError = makeError; -function appendTsSuffixIfMatch(patterns, path) { - if (patterns.length > 0) { - for (var _i = 0, patterns_1 = patterns; _i < patterns_1.length; _i++) { - var regexp = patterns_1[_i]; - if (path.match(regexp)) { - return path + '.ts'; - } - } - } - return path; -} -exports.appendTsSuffixIfMatch = appendTsSuffixIfMatch; -/** - * Recursively collect all possible dependants of passed file - */ -function collectAllDependants(reverseDependencyGraph, fileName, collected) { - if (collected === void 0) { collected = {}; } - var result = {}; - result[fileName] = true; - collected[fileName] = true; - if (reverseDependencyGraph[fileName]) { - Object.keys(reverseDependencyGraph[fileName]).forEach(function (dependantFileName) { - if (!collected[dependantFileName]) { - collectAllDependants(reverseDependencyGraph, dependantFileName, collected) - .forEach(function (fName) { return result[fName] = true; }); - } - }); - } - return Object.keys(result); -} -exports.collectAllDependants = collectAllDependants; -/** - * Recursively collect all possible dependencies of passed file - */ -function collectAllDependencies(dependencyGraph, filePath, collected) { - if (collected === void 0) { collected = {}; } - var result = {}; - result[filePath] = true; - collected[filePath] = true; - var directDependencies = dependencyGraph[filePath]; - if (directDependencies) { - directDependencies.forEach(function (dependencyModule) { - if (!collected[dependencyModule.originalFileName]) { - collectAllDependencies(dependencyGraph, dependencyModule.resolvedFileName, collected) - .forEach(function (filePath) { return result[filePath] = true; }); - } - }); - } - return Object.keys(result); -} -exports.collectAllDependencies = collectAllDependencies; -function arrify(val) { - if (val === null || val === undefined) { - return []; - } - return Array.isArray(val) ? val : [val]; -} -exports.arrify = arrify; -; diff --git a/node_modules/ts-loader/dist/watch-run.js b/node_modules/ts-loader/dist/watch-run.js deleted file mode 100644 index 7c96d796b..000000000 --- a/node_modules/ts-loader/dist/watch-run.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -var path = require("path"); -var utils = require("./utils"); -var constants = require("./constants"); -/** - * Make function which will manually update changed files - */ -function makeWatchRun(instance) { - var lastTimes = {}; - var startTime = null; - return function (watching, cb) { - var watcher = watching.compiler.watchFileSystem.watcher || - watching.compiler.watchFileSystem.wfs.watcher; - if (null === instance.modifiedFiles) { - instance.modifiedFiles = {}; - } - startTime = startTime || watching.startTime; - var times = watcher.getTimes(); - Object.keys(times) - .filter(function (filePath) { - return times[filePath] > (lastTimes[filePath] || startTime) - && !!filePath.match(constants.tsTsxJsJsxRegex); - }) - .forEach(function (filePath) { - lastTimes[filePath] = times[filePath]; - filePath = path.normalize(filePath); - var file = instance.files[filePath]; - if (file) { - file.text = utils.readFile(filePath) || ''; - file.version++; - instance.version++; - instance.modifiedFiles[filePath] = file; - } - }); - cb(); - }; -} -module.exports = makeWatchRun; diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/README.md b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/README.md deleted file mode 100644 index e7a0cb064..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# TypeScript, Babel, React, and Karma Sample
-
-## Getting started
-
-You'll need [node / npm](https://nodejs.org/) installed. To get up and running just enter:
-
-```
-npm install
-npm run serve
-```
-
-This will:
-
-1. Download the npm packages you need (including the type definitions from DefinitelyTyped)
-2. Compile the code and serve it up at [http://localhost:8080](http://localhost:8080)
-
diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/clean.js b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/clean.js deleted file mode 100644 index c51b4e416..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/clean.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var del = require('del'); -var gutil = require('gulp-util'); -var fs = require('fs'); - -function run(done) { - fs.stat('./dist', function(err){ - if (err) { - // Never existed - done(); - } - else { - del(['./dist'], { force: true }) - .then(function(paths) { - gutil.log('Deleted files/folders:\n', paths.join('\n')); - done(); - }) - .catch(function(error) { - gutil.log('Problem deleting:\n', error); - done(); - }); - } - }); -} - -module.exports = { - run: function(done) { return run(done); } -}; diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/inject.js b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/inject.js deleted file mode 100644 index e4133e565..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/inject.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var inject = require('gulp-inject'); -var glob = require('glob'); - -function injectIndex(options) { - function run() { - var target = gulp.src('./src/index.html'); - var sources = gulp.src([ - //'./dist/styles/main*.css', - './dist/scripts/vendor*.js', - './dist/scripts/main*.js' - ], { read: false }); - - return target - .pipe(inject(sources, { ignorePath: '/dist/', addRootSlash: false, removeTags: true })) - .pipe(gulp.dest('./dist')); - } - - var jsCssGlob = 'dist/**/*.{js,css}'; - - function checkForInitialFilesThenRun() { - glob(jsCssGlob, function (er, files) { - var filesWeNeed = ['dist/scripts/main', 'dist/scripts/vendor'/*, 'dist/styles/main'*/]; - - function fileIsPresent(fileWeNeed) { - return files.some(function(file) { - return file.indexOf(fileWeNeed) !== -1; - }); - } - - if (filesWeNeed.every(fileIsPresent)) { - run('initial build'); - } else { - checkForInitialFilesThenRun(); - } - }); - } - - checkForInitialFilesThenRun(); - - if (options.shouldWatch) { - gulp.watch(jsCssGlob, function(evt) { - if (evt.path && evt.type === 'changed') { - run(evt.path); - } - }); - } -} - -module.exports = { - build: function() { return injectIndex({ shouldWatch: false }); }, - watch: function() { return injectIndex({ shouldWatch: true }); } -}; diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/staticFiles.js b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/staticFiles.js deleted file mode 100644 index 20327f272..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/staticFiles.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var cache = require('gulp-cached'); - -var targets = [ - { description: 'INDEX', src: './src/index.html', dest: './dist' } -]; - -function copy(options) { - function run(target) { - gulp.src(target.src) - .pipe(cache(target.description)) - .pipe(gulp.dest(target.dest)); - } - - function watch(target) { - gulp.watch(target.src, function() { run(target); }); - } - - targets.forEach(run); - - if (options.shouldWatch) { - targets.forEach(watch); - } -} - -module.exports = { - build: function() { return copy({ shouldWatch: false }); }, - watch: function() { return copy({ shouldWatch: true }); } -}; diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/tests.js b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/tests.js deleted file mode 100644 index 05af0a551..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/tests.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -var Server = require('karma').Server; -var path = require('path'); -var gutil = require('gulp-util'); - -function runTests(options) { - // Documentation: https://karma-runner.github.io/0.13/dev/public-api.html - var karmaConfig = { - configFile: path.join(__dirname, '../karma.conf.js'), - singleRun: !options.shouldWatch, - - plugins: ['karma-webpack', 'karma-jasmine', 'karma-mocha-reporter', 'karma-sourcemap-loader', 'karma-phantomjs-launcher'], - reporters: ['mocha'] - }; - - if (options.done) { - karmaConfig.plugins.push('karma-junit-reporter'); - karmaConfig.reporters.push('junit'); - } else { - karmaConfig.plugins.push('karma-notify-reporter'); - karmaConfig.reporters.push('notify'); - } - - new Server(karmaConfig, karmaCompleted).start(); - - function karmaCompleted(exitCode) { - if (options.done) { - if (exitCode === 1) { - gutil.log('Karma: tests failed with code ' + exitCode); - } else { - gutil.log('Karma completed!'); - } - options.done(); - } - else { - process.exit(exitCode); - } - } -} - -module.exports = { - run: function(done) { return runTests({ shouldWatch: false, done: done }); }, - watch: function() { return runTests({ shouldWatch: true }); } -}; diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/webpack.js b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/webpack.js deleted file mode 100644 index 7607c122b..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulp/webpack.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var gutil = require('gulp-util'); -var webpack = require('webpack'); -var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); -var ForkTsCheckerNotifierWebpackPlugin = require('fork-ts-checker-notifier-webpack-plugin'); -var webpackFailPlugin = require('webpack-fail-plugin'); - -var webpackConfig = require('../webpack.config.js'); -var packageJson = require('../package.json'); - -function buildProduction(done) { - // modify some webpack config options - var myProdConfig = webpackConfig; - myProdConfig.output.filename = '[name].[hash].js'; - - myProdConfig.plugins = myProdConfig.plugins.concat( - new webpack.DefinePlugin({ - 'process.env': { - 'NODE_ENV': JSON.stringify('production') - } - }), - new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.[hash].js' }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: true - } - }), - new ForkTsCheckerWebpackPlugin({ - blockEmit: true, - // tslint: true, - watch: ['./src', './test'] // optional but improves performance (less stat calls) - }), - webpackFailPlugin - ); - - // run webpack - webpack(myProdConfig, function (err, stats) { - if (err) { throw new gutil.PluginError('webpack:build', err); } - gutil.log('[webpack:build]', stats.toString({ - colors: true - })); - - if (done) { done(); } - }); -} - -function createDevCompiler() { - // modify some webpack config options - var myDevConfig = webpackConfig; - myDevConfig.devtool = 'inline-source-map'; - - myDevConfig.plugins = myDevConfig.plugins.concat( - new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.js' }), - new ForkTsCheckerNotifierWebpackPlugin ({ title: 'Build', excludeWarnings: false }), - new ForkTsCheckerWebpackPlugin({ - blockEmit: false, - // tslint: true, - watch: ['./src'] // optional but improves performance (less stat calls) - }) - ); - - // create a single instance of the compiler to allow caching - return webpack(myDevConfig); -} - -function build() { - return new Promise(function (resolve, reject) { - buildProduction(function (err) { - if (err) { - reject(err); - } else { - resolve('webpack built'); - } - }); - }); -} - -function watch() { - var firstBuildDone = false; - - return new Promise(function (resolve, reject) { - var devCompiler = createDevCompiler(); - devCompiler.watch({ // watch options: - aggregateTimeout: 300 // wait so long for more changes - }, function (err, stats) { - if (err) { - if (!firstBuildDone) { - firstBuildDone = true; - reject(err); - } - throw new gutil.PluginError('webpack:build-dev', err); - } else { - if (!firstBuildDone) { - firstBuildDone = true; - resolve('webpack built'); - } - } - - gutil.log('[webpack:build-dev]', stats.toString({ - chunks: false, - colors: true - })); - }); - }); -} - -module.exports = { - build: function () { return build(); }, - watch: function () { return watch(); } -}; diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulpFile.js b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulpFile.js deleted file mode 100644 index 02fcbc0d5..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/gulpFile.js +++ /dev/null @@ -1,54 +0,0 @@ -/* eslint-disable no-var, strict, prefer-arrow-callback */ -'use strict'; - -var gulp = require('gulp'); -var gutil = require('gulp-util'); -var webpack = require('./gulp/webpack'); -var staticFiles = require('./gulp/staticFiles'); -var tests = require('./gulp/tests'); -var clean = require('./gulp/clean'); -var inject = require('./gulp/inject'); - -var lintSrcs = ['./gulp/**/*.js']; - -gulp.task('delete-dist', function (done) { - clean.run(done); -}); - -gulp.task('build-js', ['delete-dist'], function(done) { - webpack.build().then(function() { done(); }); -}); - -gulp.task('build-other', ['delete-dist'], function() { - staticFiles.build(); -}); - -gulp.task('build', ['build-js', 'build-other'], function () { - inject.build(); -}); - -gulp.task('watch', ['delete-dist'], function(done) { - process.env.NODE_ENV = 'development'; - Promise.all([ - webpack.watch()//, - //less.watch() - ]).then(function() { - gutil.log('Now that initial assets (js and css) are generated inject will start...'); - inject.watch(); - done(); - }).catch(function(error) { - gutil.log('Problem generating initial assets (js and css)', error); - }); - - staticFiles.watch(); - tests.watch(); -}); - -gulp.task('watch-and-serve', ['watch'], function() { - // local as not required for build - var express = require('express') - var app = express() - - app.use(express.static('dist', {'index': 'index.html'})) - app.listen(8080); -}); diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/karma.conf.js b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/karma.conf.js deleted file mode 100644 index 1c35404d6..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/karma.conf.js +++ /dev/null @@ -1,69 +0,0 @@ -/* eslint-disable no-var, strict */ -'use strict'; - -var webpackConfig = require('./webpack.config.js'); -var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); -var ForkTsCheckerNotifierWebpackPlugin = require('fork-ts-checker-notifier-webpack-plugin'); - -module.exports = function (config) { - var forkTsCheckerOptions = { - blockEmit: true, - watch: ['./test'] // optional but improves performance (less stat calls) - }; - var plugins = config.singleRun - ? [ - new ForkTsCheckerWebpackPlugin(forkTsCheckerOptions) - ] - : [ - new ForkTsCheckerNotifierWebpackPlugin({ title: 'Tests Build', excludeWarnings: false }), - new ForkTsCheckerWebpackPlugin(Object.assign({}, forkTsCheckerOptions, { blockEmit: false })) - ]; - - // Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html - config.set({ - browsers: ['PhantomJS'], - - files: [ - // This ensures we have the es6 shims in place and then loads all the tests - 'test/main.js' - ], - - port: 9876, - - frameworks: ['jasmine'], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'test/main.js': ['webpack', 'sourcemap'] - }, - - webpack: { - devtool: 'inline-source-map', - module: webpackConfig.module, - resolve: webpackConfig.resolve, - plugins: plugins - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: { - colors: { - success: 'bgGreen', - info: 'cyan', - warning: 'bgBlue', - error: 'bgRed' - } - }, - - notifyReporter: { - reportSuccess: false // Default: true, Will notify when a suite was successful - } - }); -}; diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/package.json b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/package.json deleted file mode 100644 index a651593b8..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{
- "name": "es6-babel-react-flux-karma",
- "version": "1.0.0",
- "description": "ES6 + TypeScript + Babel + React + Karma: The Secret Recipe",
- "main": "index.js",
- "scripts": {
- "test": "karma start --reporters mocha,junit --single-run --browsers PhantomJS",
- "serve": "gulp watch-and-serve",
- "watch": "gulp watch",
- "build": "gulp build"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/microsoft/typescriptsamples.git"
- },
- "keywords": [
- "React",
- "Flux",
- "ES2016",
- "typescript"
- ],
- "author": "John Reilly",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/microsoft/typescriptsamples/issues"
- },
- "homepage": "https://github.com/Microsoft/TypeScriptSamples/tree/master/es6-babel-react-flux-karma#readme",
- "devDependencies": {
- "@types/fbemitter": "^2.0.32",
- "@types/flux": "0.0.32",
- "@types/jasmine": "^2.5.35",
- "@types/react": "^0.14.41",
- "@types/react-addons-test-utils": "^0.14.15",
- "@types/react-bootstrap": "0.0.33",
- "@types/react-dom": "^0.14.18",
- "@types/react-test-renderer": "^15.5.0",
- "babel": "^6.0.0",
- "babel-core": "^6.0.0",
- "babel-loader": "^7.0.0",
- "babel-preset-es2015": "^6.0.0",
- "babel-preset-es2016": "^6.16.0",
- "babel-preset-react": "^6.0.0",
- "del": "^2.0.2",
- "express": "^4.13.3",
- "fork-ts-checker-notifier-webpack-plugin": "^0.1.3",
- "fork-ts-checker-webpack-plugin": "^0.1.1",
- "glob": "^7.0.0",
- "gulp": "^3.9.0",
- "gulp-autoprefixer": "^3.1.0",
- "gulp-cached": "^1.1.0",
- "gulp-cssmin": "^0.1.7",
- "gulp-eslint": "^2.0.0",
- "gulp-if": "^2.0.0",
- "gulp-inject": "^3.0.0",
- "gulp-notify": "^2.2.0",
- "gulp-sourcemaps": "^1.5.2",
- "gulp-streamify": "1.0.2",
- "gulp-uglify": "^1.2.0",
- "gulp-util": "^3.0.6",
- "jasmine-core": "^2.3.4",
- "karma": "^1.2.0",
- "karma-jasmine": "^1.0.0",
- "karma-junit-reporter": "^1.0.0",
- "karma-mocha-reporter": "^2.0.0",
- "karma-notify-reporter": "^1.0.0",
- "karma-phantomjs-launcher": "^1.0.0",
- "karma-sourcemap-loader": "^0.3.6",
- "karma-webpack": "^2.0.1",
- "phantomjs-prebuilt": "^2.1.4",
- "react-addons-test-utils": "^15.3.1",
- "react-test-renderer": "^15.5.4",
- "ts-loader": "^2.0.0",
- "tslint": "^5.1.0",
- "tslint-react": "^3.0.0",
- "typescript": "^2.1.4",
- "webpack": "^2.2.0",
- "webpack-fail-plugin": "^1.0.4",
- "webpack-notifier": "^1.2.1"
- },
- "dependencies": {
- "babel-polyfill": "^6.0.0",
- "flux": "^2.0.3",
- "fbemitter": "^2.0.2",
- "react": "^15.4.1",
- "react-dom": "^15.4.1"
- }
-}
diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/tsconfig.json b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/tsconfig.json deleted file mode 100644 index c3a732c12..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{
- "compileOnSave": false,
- "compilerOptions": {
- "allowSyntheticDefaultImports": true,
- "lib": [
- "dom",
- "es2015",
- "es2016"
- ],
- "jsx": "preserve",
- "target": "es2016",
- "module": "es2015",
- "moduleResolution": "node",
- "noImplicitAny": true,
- "noUnusedLocals": true,
- "noUnusedParameters": true,
- "removeComments": false,
- "preserveConstEnums": true,
- "sourceMap": true,
- "skipLibCheck": true
- }
-}
\ No newline at end of file diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/tslint.json b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/tslint.json deleted file mode 100644 index 40d93780b..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/tslint.json +++ /dev/null @@ -1,91 +0,0 @@ -{
- "extends": [
- "tslint:recommended",
- "tslint-react"
- ],
- "rules": {
- "arrow-parens": false,
- "class-name": true,
- "comment-format": [
- true,
- "check-space"
- ],
- "indent": [
- true,
- "spaces"
- ],
- "interface-name": [
- false
- ],
- "jsx-alignment": false,
- "jsx-no-lambda": true,
- "jsx-wrap-multiline": false,
- "jsx-no-multiline-js": false,
- "jsx-no-string-ref": true,
- "jsx-self-close": true,
- "jsx-curly-spacing": "always",
- "jsx-boolean-value": false,
- "max-classes-per-file": {
- "severity": "warning",
- "options": [true, 1]
- },
- "max-line-length": [
- false
- ],
- "member-access": false,
- "no-duplicate-variable": true,
- "no-empty": false,
- "no-eval": true,
- "no-internal-module": true,
- "no-trailing-whitespace": true,
- "no-var-keyword": true,
- "object-literal-sort-keys": false,
- "one-line": [
- true,
- "check-open-brace",
- "check-whitespace"
- ],
- "ordered-imports": false,
- "radix": false,
- "quotemark": [
- true,
- "single",
- "avoid-escape",
- "jsx-double"
- ],
- "semicolon": [
- true,
- "always"
- ],
- "switch-default": false,
- "trailing-comma": [
- false
- ],
- "triple-equals": [
- true,
- "allow-null-check"
- ],
- "typedef-whitespace": [
- true,
- {
- "call-signature": "nospace",
- "index-signature": "nospace",
- "parameter": "nospace",
- "property-declaration": "nospace",
- "variable-declaration": "nospace"
- }
- ],
- "variable-name": [
- true,
- "ban-keywords"
- ],
- "whitespace": [
- true,
- "check-branch",
- "check-decl",
- "check-operator",
- "check-separator",
- "check-type"
- ]
- }
-}
\ No newline at end of file diff --git a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/webpack.config.js b/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/webpack.config.js deleted file mode 100644 index 4c2922969..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker-react-babel-karma-gulp/webpack.config.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -var path = require('path'); - -var babelOptions = { - "presets": [ - "react", - [ - "es2015", - { - "modules": false - } - ], - "es2016" - ] -}; - -module.exports = { - cache: true, - entry: { - main: './src/main.tsx', - vendor: [ - 'babel-polyfill', - 'fbemitter', - 'flux', - 'react', - 'react-dom' - ] - }, - output: { - path: path.resolve(__dirname, './dist/scripts'), - filename: '[name].js', - chunkFilename: '[chunkhash].js' - }, - module: { - rules: [{ - test: /\.ts(x?)$/, - exclude: /node_modules/, - use: [ - { - loader: 'babel-loader', - options: babelOptions - }, - { - loader: 'ts-loader', - options: { transpileOnly: true } - } - ] - }, { - test: /\.js$/, - exclude: /node_modules/, - use: [ - { - loader: 'babel-loader', - options: babelOptions - } - ] - }] - }, - plugins: [ - ], - resolve: { - extensions: ['.ts', '.tsx', '.js'] - }, -}; diff --git a/node_modules/ts-loader/examples/fork-ts-checker/package.json b/node_modules/ts-loader/examples/fork-ts-checker/package.json deleted file mode 100644 index ee7197974..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{
- "name": "webpack2-fork-ts-checker",
- "main": "index.js",
- "version": "1.0.0",
- "scripts": {
- "start": "./node_modules/.bin/webpack --watch"
- },
- "devDependencies": {
- "fork-ts-checker-webpack-plugin": "^0.1.2",
- "ts-loader": "^2.0.3",
- "typescript": "^2.2.2",
- "webpack": "^2.2.0"
- }
-}
diff --git a/node_modules/ts-loader/examples/fork-ts-checker/tsconfig.json b/node_modules/ts-loader/examples/fork-ts-checker/tsconfig.json deleted file mode 100644 index 655163c00..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{
- "compilerOptions": {
- }
-}
diff --git a/node_modules/ts-loader/examples/fork-ts-checker/webpack.config.js b/node_modules/ts-loader/examples/fork-ts-checker/webpack.config.js deleted file mode 100644 index bac2155e0..000000000 --- a/node_modules/ts-loader/examples/fork-ts-checker/webpack.config.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -var process = require('process'); -var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); - -module.exports = { - context: __dirname, // to automatically find tsconfig.json - entry: './src/index.ts', - output: { filename: 'index.js' }, - module: { - rules: [ - { - test: /\.tsx?$/, - loader: 'ts-loader', - options: { - transpileOnly: true // IMPORTANT! use transpileOnly mode to speed-up compilation - } - } - ] - }, - resolve: { - extensions: [ '.ts', '.tsx' ] - }, - plugins: [ - new ForkTsCheckerWebpackPlugin({ - tslint: false, // disable tslint support - watch: './src', // optional but improves performance (less stat calls) - workers: ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE, // use multi-process mode, leave 2 cpu's free for builder and system - blockEmit: process.env.NODE_ENV === 'production' // for production make it synchronous - }) - ] -}; diff --git a/node_modules/ts-loader/examples/react-babel-karma-gulp/README.md b/node_modules/ts-loader/examples/react-babel-karma-gulp/README.md deleted file mode 100644 index e7a0cb064..000000000 --- a/node_modules/ts-loader/examples/react-babel-karma-gulp/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# TypeScript, Babel, React, and Karma Sample
-
-## Getting started
-
-You'll need [node / npm](https://nodejs.org/) installed. To get up and running just enter:
-
-```
-npm install
-npm run serve
-```
-
-This will:
-
-1. Download the npm packages you need (including the type definitions from DefinitelyTyped)
-2. Compile the code and serve it up at [http://localhost:8080](http://localhost:8080)
-
diff --git a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/clean.js b/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/clean.js deleted file mode 100644 index c51b4e416..000000000 --- a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/clean.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var del = require('del'); -var gutil = require('gulp-util'); -var fs = require('fs'); - -function run(done) { - fs.stat('./dist', function(err){ - if (err) { - // Never existed - done(); - } - else { - del(['./dist'], { force: true }) - .then(function(paths) { - gutil.log('Deleted files/folders:\n', paths.join('\n')); - done(); - }) - .catch(function(error) { - gutil.log('Problem deleting:\n', error); - done(); - }); - } - }); -} - -module.exports = { - run: function(done) { return run(done); } -}; diff --git a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/inject.js b/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/inject.js deleted file mode 100644 index e4133e565..000000000 --- a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/inject.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var inject = require('gulp-inject'); -var glob = require('glob'); - -function injectIndex(options) { - function run() { - var target = gulp.src('./src/index.html'); - var sources = gulp.src([ - //'./dist/styles/main*.css', - './dist/scripts/vendor*.js', - './dist/scripts/main*.js' - ], { read: false }); - - return target - .pipe(inject(sources, { ignorePath: '/dist/', addRootSlash: false, removeTags: true })) - .pipe(gulp.dest('./dist')); - } - - var jsCssGlob = 'dist/**/*.{js,css}'; - - function checkForInitialFilesThenRun() { - glob(jsCssGlob, function (er, files) { - var filesWeNeed = ['dist/scripts/main', 'dist/scripts/vendor'/*, 'dist/styles/main'*/]; - - function fileIsPresent(fileWeNeed) { - return files.some(function(file) { - return file.indexOf(fileWeNeed) !== -1; - }); - } - - if (filesWeNeed.every(fileIsPresent)) { - run('initial build'); - } else { - checkForInitialFilesThenRun(); - } - }); - } - - checkForInitialFilesThenRun(); - - if (options.shouldWatch) { - gulp.watch(jsCssGlob, function(evt) { - if (evt.path && evt.type === 'changed') { - run(evt.path); - } - }); - } -} - -module.exports = { - build: function() { return injectIndex({ shouldWatch: false }); }, - watch: function() { return injectIndex({ shouldWatch: true }); } -}; diff --git a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/staticFiles.js b/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/staticFiles.js deleted file mode 100644 index 20327f272..000000000 --- a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/staticFiles.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var cache = require('gulp-cached'); - -var targets = [ - { description: 'INDEX', src: './src/index.html', dest: './dist' } -]; - -function copy(options) { - function run(target) { - gulp.src(target.src) - .pipe(cache(target.description)) - .pipe(gulp.dest(target.dest)); - } - - function watch(target) { - gulp.watch(target.src, function() { run(target); }); - } - - targets.forEach(run); - - if (options.shouldWatch) { - targets.forEach(watch); - } -} - -module.exports = { - build: function() { return copy({ shouldWatch: false }); }, - watch: function() { return copy({ shouldWatch: true }); } -}; diff --git a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/tests.js b/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/tests.js deleted file mode 100644 index 05af0a551..000000000 --- a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/tests.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -var Server = require('karma').Server; -var path = require('path'); -var gutil = require('gulp-util'); - -function runTests(options) { - // Documentation: https://karma-runner.github.io/0.13/dev/public-api.html - var karmaConfig = { - configFile: path.join(__dirname, '../karma.conf.js'), - singleRun: !options.shouldWatch, - - plugins: ['karma-webpack', 'karma-jasmine', 'karma-mocha-reporter', 'karma-sourcemap-loader', 'karma-phantomjs-launcher'], - reporters: ['mocha'] - }; - - if (options.done) { - karmaConfig.plugins.push('karma-junit-reporter'); - karmaConfig.reporters.push('junit'); - } else { - karmaConfig.plugins.push('karma-notify-reporter'); - karmaConfig.reporters.push('notify'); - } - - new Server(karmaConfig, karmaCompleted).start(); - - function karmaCompleted(exitCode) { - if (options.done) { - if (exitCode === 1) { - gutil.log('Karma: tests failed with code ' + exitCode); - } else { - gutil.log('Karma completed!'); - } - options.done(); - } - else { - process.exit(exitCode); - } - } -} - -module.exports = { - run: function(done) { return runTests({ shouldWatch: false, done: done }); }, - watch: function() { return runTests({ shouldWatch: true }); } -}; diff --git a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/webpack.js b/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/webpack.js deleted file mode 100644 index 2ecbf42ea..000000000 --- a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulp/webpack.js +++ /dev/null @@ -1,100 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var gutil = require('gulp-util'); -var webpack = require('webpack'); -var WebpackNotifierPlugin = require('webpack-notifier'); -var failPlugin = require('webpack-fail-plugin'); -var webpackConfig = require('../webpack.config.js'); -var packageJson = require('../package.json'); - -function buildProduction(done) { - // modify some webpack config options - var myProdConfig = webpackConfig; - myProdConfig.output.filename = '[name].[hash].js'; - - myProdConfig.plugins = myProdConfig.plugins.concat( - new webpack.DefinePlugin({ - 'process.env': { - 'NODE_ENV': JSON.stringify('production') - } - }), - new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.[hash].js' }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: true - } - }), - failPlugin - ); - - // run webpack - webpack(myProdConfig, function (err, stats) { - if (err) { throw new gutil.PluginError('webpack:build', err); } - gutil.log('[webpack:build]', stats.toString({ - colors: true - })); - - if (done) { done(); } - }); -} - -function createDevCompiler() { - // modify some webpack config options - var myDevConfig = webpackConfig; - myDevConfig.devtool = 'inline-source-map'; - - myDevConfig.plugins = myDevConfig.plugins.concat( - new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.js' }), - new WebpackNotifierPlugin({ title: 'Webpack build', excludeWarnings: true }) - ); - - // create a single instance of the compiler to allow caching - return webpack(myDevConfig); -} - -function build() { - return new Promise(function (resolve, reject) { - buildProduction(function (err) { - if (err) { - reject(err); - } else { - resolve('webpack built'); - } - }); - }); -} - -function watch() { - var firstBuildDone = false; - - return new Promise(function (resolve, reject) { - var devCompiler = createDevCompiler(); - devCompiler.watch({ // watch options: - aggregateTimeout: 300 // wait so long for more changes - }, function (err, stats) { - if (err) { - if (!firstBuildDone) { - firstBuildDone = true; - reject(err); - } - throw new gutil.PluginError('webpack:build-dev', err); - } else { - if (!firstBuildDone) { - firstBuildDone = true; - resolve('webpack built'); - } - } - - gutil.log('[webpack:build-dev]', stats.toString({ - chunks: false, - colors: true - })); - }); - }); -} - -module.exports = { - build: function () { return build(); }, - watch: function () { return watch(); } -}; diff --git a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulpFile.js b/node_modules/ts-loader/examples/react-babel-karma-gulp/gulpFile.js deleted file mode 100644 index 03c6a6b4e..000000000 --- a/node_modules/ts-loader/examples/react-babel-karma-gulp/gulpFile.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var gutil = require('gulp-util'); -var webpack = require('./gulp/webpack'); -var staticFiles = require('./gulp/staticFiles'); -var tests = require('./gulp/tests'); -var clean = require('./gulp/clean'); -var inject = require('./gulp/inject'); - -gulp.task('delete-dist', function (done) { - clean.run(done); -}); - -gulp.task('build-js', ['delete-dist'], function(done) { - webpack.build().then(function() { done(); }); -}); - -gulp.task('build-other', ['delete-dist'], function() { - staticFiles.build(); -}); - -gulp.task('build', ['build-js', 'build-other'], function () { - inject.build(); -}); - -gulp.task('watch', ['delete-dist'], function(done) { - Promise.all([ - webpack.watch() - ]).then(function() { - gutil.log('Now that initial assets (js and css) are generated inject will start...'); - inject.watch(); - done(); - }).catch(function(error) { - gutil.log('Problem generating initial assets (js and css)', error); - }); - - staticFiles.watch(); - tests.watch(); -}); - -gulp.task('watch-and-serve', ['watch'], function() { - // local as not required for build - var express = require('express') - var app = express() - - app.use(express.static('dist', {'index': 'index.html'})) - app.listen(8080); -}); diff --git a/node_modules/ts-loader/examples/react-babel-karma-gulp/karma.conf.js b/node_modules/ts-loader/examples/react-babel-karma-gulp/karma.conf.js deleted file mode 100644 index f07fbc179..000000000 --- a/node_modules/ts-loader/examples/react-babel-karma-gulp/karma.conf.js +++ /dev/null @@ -1,49 +0,0 @@ -/* eslint-disable no-var, strict */ -'use strict'; - -var webpackConfig = require('./webpack.config.js'); - -module.exports = function(config) { - // Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html - config.set({ - browsers: [ 'PhantomJS' ], - - files: [ - // This ensures we have the es6 shims in place and then loads all the tests - 'test/main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'test/main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - module: webpackConfig.module, - resolve: webpackConfig.resolve - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: { - colors: { - success: 'bgGreen', - info: 'cyan', - warning: 'bgBlue', - error: 'bgRed' - } - } - }); -}; diff --git a/node_modules/ts-loader/examples/react-babel-karma-gulp/package.json b/node_modules/ts-loader/examples/react-babel-karma-gulp/package.json deleted file mode 100644 index 52ed4c468..000000000 --- a/node_modules/ts-loader/examples/react-babel-karma-gulp/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{
- "name": "es6-babel-react-flux-karma",
- "version": "1.0.0",
- "description": "ES6 + TypeScript + Babel + React + Karma: The Secret Recipe",
- "main": "index.js",
- "scripts": {
- "test": "karma start --reporters mocha,junit --single-run --browsers PhantomJS",
- "serve": "gulp watch-and-serve",
- "watch": "gulp watch",
- "build": "gulp build"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/microsoft/typescriptsamples.git"
- },
- "keywords": [
- "React",
- "Flux",
- "ES2016",
- "typescript"
- ],
- "author": "John Reilly",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/microsoft/typescriptsamples/issues"
- },
- "homepage": "https://github.com/Microsoft/TypeScriptSamples/tree/master/es6-babel-react-flux-karma#readme",
- "devDependencies": {
- "@types/fbemitter": "^2.0.32",
- "@types/flux": "0.0.32",
- "@types/jasmine": "^2.5.35",
- "@types/react": "^0.14.41",
- "@types/react-addons-test-utils": "^0.14.15",
- "@types/react-test-renderer": "^15.5.0",
- "@types/react-bootstrap": "0.0.33",
- "@types/react-dom": "^0.14.18",
- "babel": "^6.0.0",
- "babel-core": "^6.0.0",
- "babel-loader": "^7.0.0",
- "babel-preset-es2015": "^6.0.0",
- "babel-preset-es2016": "^6.16.0",
- "babel-preset-react": "^6.0.0",
- "del": "^2.0.2",
- "eslint": "^2.0.0",
- "express": "^4.13.3",
- "glob": "^7.0.0",
- "gulp": "^3.9.0",
- "gulp-autoprefixer": "^3.1.0",
- "gulp-cached": "^1.1.0",
- "gulp-cssmin": "^0.1.7",
- "gulp-eslint": "^2.0.0",
- "gulp-if": "^2.0.0",
- "gulp-inject": "^3.0.0",
- "gulp-notify": "^2.2.0",
- "gulp-sourcemaps": "^1.5.2",
- "gulp-streamify": "1.0.2",
- "gulp-uglify": "^1.2.0",
- "gulp-util": "^3.0.6",
- "jasmine-core": "^2.3.4",
- "karma": "^1.2.0",
- "karma-jasmine": "^1.0.0",
- "karma-junit-reporter": "^1.0.0",
- "karma-mocha-reporter": "^2.0.0",
- "karma-notify-reporter": "^1.0.0",
- "karma-phantomjs-launcher": "^1.0.0",
- "karma-sourcemap-loader": "^0.3.6",
- "karma-webpack": "^2.0.1",
- "phantomjs-prebuilt": "^2.1.4",
- "react-addons-test-utils": "^15.3.1",
- "react-test-renderer": "^15.5.4",
- "ts-loader": "^2.0.0",
- "typescript": "^2.1.4",
- "webpack": "^2.2.0",
- "webpack-fail-plugin": "^1.0.4",
- "webpack-notifier": "^1.2.1"
- },
- "dependencies": {
- "babel-polyfill": "^6.0.0",
- "flux": "^2.0.3",
- "fbemitter": "^2.0.2",
- "react": "^15.4.1",
- "react-dom": "^15.4.1"
- }
-}
diff --git a/node_modules/ts-loader/examples/react-babel-karma-gulp/tsconfig.json b/node_modules/ts-loader/examples/react-babel-karma-gulp/tsconfig.json deleted file mode 100644 index c3a732c12..000000000 --- a/node_modules/ts-loader/examples/react-babel-karma-gulp/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{
- "compileOnSave": false,
- "compilerOptions": {
- "allowSyntheticDefaultImports": true,
- "lib": [
- "dom",
- "es2015",
- "es2016"
- ],
- "jsx": "preserve",
- "target": "es2016",
- "module": "es2015",
- "moduleResolution": "node",
- "noImplicitAny": true,
- "noUnusedLocals": true,
- "noUnusedParameters": true,
- "removeComments": false,
- "preserveConstEnums": true,
- "sourceMap": true,
- "skipLibCheck": true
- }
-}
\ No newline at end of file diff --git a/node_modules/ts-loader/examples/react-babel-karma-gulp/webpack.config.js b/node_modules/ts-loader/examples/react-babel-karma-gulp/webpack.config.js deleted file mode 100644 index 60620a83f..000000000 --- a/node_modules/ts-loader/examples/react-babel-karma-gulp/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -var path = require('path'); - -var babelOptions = { - "presets": [ - "react", - [ - "es2015", - { - "modules": false - } - ], - "es2016" - ] -}; - -module.exports = { - cache: true, - entry: { - main: './src/main.tsx', - vendor: [ - 'babel-polyfill', - 'fbemitter', - 'flux', - 'react', - 'react-dom' - ] - }, - output: { - path: path.resolve(__dirname, './dist/scripts'), - filename: '[name].js', - chunkFilename: '[chunkhash].js' - }, - module: { - rules: [{ - test: /\.ts(x?)$/, - exclude: /node_modules/, - use: [ - { - loader: 'babel-loader', - options: babelOptions - }, - { - loader: 'ts-loader' - } - ] - }, { - test: /\.js$/, - exclude: /node_modules/, - use: [ - { - loader: 'babel-loader', - options: babelOptions - } - ] - }] - }, - plugins: [ - ], - resolve: { - extensions: ['.ts', '.tsx', '.js'] - }, -}; diff --git a/node_modules/ts-loader/examples/react-cdn-simple/index.html b/node_modules/ts-loader/examples/react-cdn-simple/index.html deleted file mode 100644 index 09651107e..000000000 --- a/node_modules/ts-loader/examples/react-cdn-simple/index.html +++ /dev/null @@ -1,13 +0,0 @@ -<!DOCTYPE html>
-<html>
- <head>
- <meta charset="UTF-8">
- </head>
- <body>
- <div id="wrapper"></div>
-
- <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.js"></script>
- <script src="index.js"></script>
- </body>
-</html>
diff --git a/node_modules/ts-loader/examples/react-cdn-simple/package.json b/node_modules/ts-loader/examples/react-cdn-simple/package.json deleted file mode 100644 index 33b29639d..000000000 --- a/node_modules/ts-loader/examples/react-cdn-simple/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{
- "name": "webpack2-react-cdn-simple",
- "main": "index.js",
- "version": "1.0.0",
- "scripts": {
- "build": "webpack"
- },
- "devDependencies": {
- "ts-loader": "^2.0.0",
- "webpack": "^2.2.0"
- },
- "dependencies": {
- "@types/react": "^15.0.4",
- "@types/react-dom": "^0.14.21"
- }
-}
diff --git a/node_modules/ts-loader/examples/react-cdn-simple/tsconfig.json b/node_modules/ts-loader/examples/react-cdn-simple/tsconfig.json deleted file mode 100644 index b48ecdfb6..000000000 --- a/node_modules/ts-loader/examples/react-cdn-simple/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{
- "compilerOptions": {
- "jsx": "react"
- }
-}
diff --git a/node_modules/ts-loader/examples/react-cdn-simple/webpack.config.js b/node_modules/ts-loader/examples/react-cdn-simple/webpack.config.js deleted file mode 100644 index 7abb3171d..000000000 --- a/node_modules/ts-loader/examples/react-cdn-simple/webpack.config.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -module.exports = { - entry: './src/index.tsx', - output: { filename: 'index.js' }, - module: { - rules: [ - { - test: /\.tsx?$/, - loader: 'ts-loader', - options: { - transpileOnly: true - } - } - ] - }, - resolve: { - extensions: [ '.ts', '.tsx' ] - }, - externals: { - 'react': 'React', - 'react-dom': 'ReactDOM' - } -}; diff --git a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/.eslintrc b/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/.eslintrc deleted file mode 100644 index f7aa388ad..000000000 --- a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/.eslintrc +++ /dev/null @@ -1,73 +0,0 @@ -{
- "root": true,
- "env": {
- "commonjs": true,
- },
- "rules": {
- "camelcase": 2,
- "comma-spacing": 1,
- "consistent-return": 2,
- "curly": [ 2, "all" ],
- "dot-notation": [
- 2,
- { "allowKeywords": true }
- ],
- "eol-last": 2,
- "eqeqeq": 2,
- "keyword-spacing": 2,
- "new-cap": 2,
- "new-parens": 2,
- "no-alert": 2,
- "no-array-constructor": 2,
- "no-caller": 2,
- "no-catch-shadow": 2,
- "no-eval": 2,
- "no-extend-native": 2,
- "no-extra-bind": 2,
- "no-extra-parens": [ 2, "functions" ],
- "no-implied-eval": 2,
- "no-iterator": 2,
- "no-labels": 2,
- "no-label-var": 2,
- "no-lone-blocks": 2,
- "no-loop-func": 2,
- "no-multi-str": 2,
- "no-native-reassign": 2,
- "no-new": 2,
- "no-new-func": 2,
- "no-new-object": 2,
- "no-new-wrappers": 2,
- "no-octal-escape": 2,
- "no-proto": 2,
- "no-return-assign": 2,
- "no-script-url": 2,
- "no-sequences": 2,
- "no-shadow": 2,
- "no-shadow-restricted-names": 2,
- "no-spaced-func": 2,
- "no-trailing-spaces": 1,
- "no-undef-init": 2,
- "no-unused-expressions": 2,
- "no-use-before-define": [ 2, "nofunc" ],
- "no-with": 2,
- "quotes": [ 1, "single" ],
- "semi": 2,
- "semi-spacing": [
- 2,
- {
- "before": false,
- "after": true
- }
- ],
- "space-infix-ops": 2,
- "space-unary-ops": [
- 2,
- {
- "words": true,
- "nonwords": false
- }
- ],
- "strict": [ 2, "global" ],
- "yoda": [ 2, "never" ]
- }
-}
diff --git a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/clean.js b/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/clean.js deleted file mode 100644 index c51b4e416..000000000 --- a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/clean.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var del = require('del'); -var gutil = require('gulp-util'); -var fs = require('fs'); - -function run(done) { - fs.stat('./dist', function(err){ - if (err) { - // Never existed - done(); - } - else { - del(['./dist'], { force: true }) - .then(function(paths) { - gutil.log('Deleted files/folders:\n', paths.join('\n')); - done(); - }) - .catch(function(error) { - gutil.log('Problem deleting:\n', error); - done(); - }); - } - }); -} - -module.exports = { - run: function(done) { return run(done); } -}; diff --git a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/inject.js b/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/inject.js deleted file mode 100644 index e4133e565..000000000 --- a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/inject.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var inject = require('gulp-inject'); -var glob = require('glob'); - -function injectIndex(options) { - function run() { - var target = gulp.src('./src/index.html'); - var sources = gulp.src([ - //'./dist/styles/main*.css', - './dist/scripts/vendor*.js', - './dist/scripts/main*.js' - ], { read: false }); - - return target - .pipe(inject(sources, { ignorePath: '/dist/', addRootSlash: false, removeTags: true })) - .pipe(gulp.dest('./dist')); - } - - var jsCssGlob = 'dist/**/*.{js,css}'; - - function checkForInitialFilesThenRun() { - glob(jsCssGlob, function (er, files) { - var filesWeNeed = ['dist/scripts/main', 'dist/scripts/vendor'/*, 'dist/styles/main'*/]; - - function fileIsPresent(fileWeNeed) { - return files.some(function(file) { - return file.indexOf(fileWeNeed) !== -1; - }); - } - - if (filesWeNeed.every(fileIsPresent)) { - run('initial build'); - } else { - checkForInitialFilesThenRun(); - } - }); - } - - checkForInitialFilesThenRun(); - - if (options.shouldWatch) { - gulp.watch(jsCssGlob, function(evt) { - if (evt.path && evt.type === 'changed') { - run(evt.path); - } - }); - } -} - -module.exports = { - build: function() { return injectIndex({ shouldWatch: false }); }, - watch: function() { return injectIndex({ shouldWatch: true }); } -}; diff --git a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/staticFiles.js b/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/staticFiles.js deleted file mode 100644 index 20327f272..000000000 --- a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/staticFiles.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var cache = require('gulp-cached'); - -var targets = [ - { description: 'INDEX', src: './src/index.html', dest: './dist' } -]; - -function copy(options) { - function run(target) { - gulp.src(target.src) - .pipe(cache(target.description)) - .pipe(gulp.dest(target.dest)); - } - - function watch(target) { - gulp.watch(target.src, function() { run(target); }); - } - - targets.forEach(run); - - if (options.shouldWatch) { - targets.forEach(watch); - } -} - -module.exports = { - build: function() { return copy({ shouldWatch: false }); }, - watch: function() { return copy({ shouldWatch: true }); } -}; diff --git a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/tests.js b/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/tests.js deleted file mode 100644 index 05af0a551..000000000 --- a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/tests.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -var Server = require('karma').Server; -var path = require('path'); -var gutil = require('gulp-util'); - -function runTests(options) { - // Documentation: https://karma-runner.github.io/0.13/dev/public-api.html - var karmaConfig = { - configFile: path.join(__dirname, '../karma.conf.js'), - singleRun: !options.shouldWatch, - - plugins: ['karma-webpack', 'karma-jasmine', 'karma-mocha-reporter', 'karma-sourcemap-loader', 'karma-phantomjs-launcher'], - reporters: ['mocha'] - }; - - if (options.done) { - karmaConfig.plugins.push('karma-junit-reporter'); - karmaConfig.reporters.push('junit'); - } else { - karmaConfig.plugins.push('karma-notify-reporter'); - karmaConfig.reporters.push('notify'); - } - - new Server(karmaConfig, karmaCompleted).start(); - - function karmaCompleted(exitCode) { - if (options.done) { - if (exitCode === 1) { - gutil.log('Karma: tests failed with code ' + exitCode); - } else { - gutil.log('Karma completed!'); - } - options.done(); - } - else { - process.exit(exitCode); - } - } -} - -module.exports = { - run: function(done) { return runTests({ shouldWatch: false, done: done }); }, - watch: function() { return runTests({ shouldWatch: true }); } -}; diff --git a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/webpack.js b/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/webpack.js deleted file mode 100644 index b0de5c558..000000000 --- a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulp/webpack.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var gutil = require('gulp-util'); -var webpack = require('webpack'); -var WebpackNotifierPlugin = require('webpack-notifier'); -var failPlugin = require('webpack-fail-plugin'); -var webpackConfig = require('../webpack.config.js'); -var packageJson = require('../package.json'); - -function buildProduction(done) { - // modify some webpack config options - var myProdConfig = Object.create(webpackConfig); - myProdConfig.output.filename = '[name].[hash].js'; - - myProdConfig.plugins = myProdConfig.plugins.concat( - new webpack.DefinePlugin({ - 'process.env': { - 'NODE_ENV': JSON.stringify('production') - } - }), - new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.[hash].js' }), - new webpack.optimize.DedupePlugin(), - new webpack.optimize.UglifyJsPlugin(), - failPlugin - ); - - // run webpack - webpack(myProdConfig, function (err, stats) { - if (err) { throw new gutil.PluginError('webpack:build', err); } - gutil.log('[webpack:build]', stats.toString({ - colors: true - })); - - if (done) { done(); } - }); -} - -function createDevCompiler() { - // modify some webpack config options - var myDevConfig = Object.create(webpackConfig); - myDevConfig.devtool = 'inline-source-map'; - myDevConfig.debug = true; - - myDevConfig.plugins = myDevConfig.plugins.concat( - new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.js' }), - new WebpackNotifierPlugin({ title: 'Webpack build', excludeWarnings: true }) - ); - - // create a single instance of the compiler to allow caching - return webpack(myDevConfig); -} - -function build() { - return new Promise(function (resolve, reject) { - buildProduction(function (err) { - if (err) { - reject(err); - } else { - resolve('webpack built'); - } - }); - }); -} - -function watch() { - var firstBuildDone = false; - - return new Promise(function (resolve, reject) { - var devCompiler = createDevCompiler(); - devCompiler.watch({ // watch options: - aggregateTimeout: 300 // wait so long for more changes - }, function (err, stats) { - if (err) { - if (!firstBuildDone) { - firstBuildDone = true; - reject(err); - } - throw new gutil.PluginError('webpack:build-dev', err); - } else { - if (!firstBuildDone) { - firstBuildDone = true; - resolve('webpack built'); - } - } - - gutil.log('[webpack:build-dev]', stats.toString({ - chunks: false, - colors: true - })); - }); - }); -} - -module.exports = { - build: function () { return build(); }, - watch: function () { return watch(); } -}; diff --git a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulpFile.js b/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulpFile.js deleted file mode 100644 index b7b3abe73..000000000 --- a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/gulpFile.js +++ /dev/null @@ -1,66 +0,0 @@ -/* eslint-disable no-var, strict, prefer-arrow-callback */ -'use strict'; - -var gulp = require('gulp'); -var gutil = require('gulp-util'); -var eslint = require('gulp-eslint'); -var webpack = require('./gulp/webpack'); -var staticFiles = require('./gulp/staticFiles'); -var tests = require('./gulp/tests'); -var clean = require('./gulp/clean'); -var inject = require('./gulp/inject'); - -var lintSrcs = ['./gulp/**/*.js']; - -gulp.task('delete-dist', function (done) { - clean.run(done); -}); - -gulp.task('build-process.env.NODE_ENV', function () { - process.env.NODE_ENV = 'production'; -}); - -gulp.task('build-js', ['delete-dist', 'build-process.env.NODE_ENV'], function(done) { - webpack.build().then(function() { done(); }); -}); - -gulp.task('build-other', ['delete-dist', 'build-process.env.NODE_ENV'], function() { - staticFiles.build(); -}); - -gulp.task('build', ['build-js', 'build-other', 'lint'], function () { - inject.build(); -}); - -gulp.task('lint', function () { - return gulp.src(lintSrcs) - .pipe(eslint()) - .pipe(eslint.format()); -}); - -gulp.task('watch', ['delete-dist'], function(done) { - process.env.NODE_ENV = 'development'; - Promise.all([ - webpack.watch()//, - //less.watch() - ]).then(function() { - gutil.log('Now that initial assets (js and css) are generated inject will start...'); - inject.watch(); - done(); - }).catch(function(error) { - gutil.log('Problem generating initial assets (js and css)', error); - }); - - gulp.watch(lintSrcs, ['lint']); - staticFiles.watch(); - tests.watch(); -}); - -gulp.task('watch-and-serve', ['watch'], function() { - // local as not required for build - var express = require('express') - var app = express() - - app.use(express.static('dist', {'index': 'index.html'})) - app.listen(8080); -}); diff --git a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/karma.conf.js b/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/karma.conf.js deleted file mode 100644 index 72579927f..000000000 --- a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/karma.conf.js +++ /dev/null @@ -1,66 +0,0 @@ -/* eslint-disable no-var, strict */ -'use strict'; - -var webpackConfig = require('./webpack.config.js'); - -module.exports = function(config) { - // Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html - config.set({ - browsers: [ 'PhantomJS' ], - - files: [ - // This ensures we have the es6 shims in place from babel and that angular and angular-mocks are loaded - // and then loads all the tests - 'test/main.js' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'test/main.js': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'inline-source-map', - debug: true, - module: webpackConfig.module, - resolve: webpackConfig.resolve - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: { - colors: { - success: 'bgGreen', - info: 'cyan', - warning: 'bgBlue', - error: 'bgRed' - } - }, - - // the default configuration - junitReporter: { - outputDir: 'test-results', // results will be saved as $outputDir/$browserName.xml - outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile - suite: '' - }, - - coverageReporter: { - reporters:[ - //{type: 'html', dir:'coverage/'}, // https://github.com/karma-runner/karma-coverage/issues/123 - {type: 'text'}, - {type: 'text-summary'} - ], - } - }); -}; diff --git a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/package.json b/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/package.json deleted file mode 100644 index 131bb2911..000000000 --- a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{
- "name": "es6-babel-react-flux-karma",
- "version": "1.0.0",
- "description": "ES6 + TypeScript + Babel + React + Karma: The Secret Recipe",
- "main": "index.js",
- "scripts": {
- "test": "karma start --reporters mocha,junit --single-run --browsers PhantomJS",
- "serve": "gulp watch-and-serve",
- "watch": "gulp watch",
- "build": "gulp build"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/microsoft/typescriptsamples.git"
- },
- "keywords": [
- "React",
- "Flux",
- "ES2016",
- "typescript"
- ],
- "author": "John Reilly",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/microsoft/typescriptsamples/issues"
- },
- "homepage": "https://github.com/Microsoft/TypeScriptSamples/tree/master/es6-babel-react-flux-karma#readme",
- "devDependencies": {
- "@types/fbemitter": "^2.0.32",
- "@types/flux": "0.0.32",
- "@types/jasmine": "^2.5.35",
- "@types/react": "^0.14.41",
- "@types/react-addons-test-utils": "^0.14.15",
- "@types/react-bootstrap": "0.0.33",
- "@types/react-dom": "^0.14.18",
- "babel": "^6.0.0",
- "babel-core": "^6.0.0",
- "babel-loader": "^6.0.0",
- "babel-preset-es2015": "^6.0.0",
- "babel-preset-es2016": "^6.16.0",
- "babel-preset-react": "^6.0.0",
- "del": "^2.0.2",
- "eslint": "^2.0.0",
- "express": "^4.13.3",
- "glob": "^7.0.0",
- "gulp": "^3.9.0",
- "gulp-autoprefixer": "^3.1.0",
- "gulp-cached": "^1.1.0",
- "gulp-cssmin": "^0.1.7",
- "gulp-eslint": "^2.0.0",
- "gulp-if": "^2.0.0",
- "gulp-inject": "^3.0.0",
- "gulp-notify": "^2.2.0",
- "gulp-sourcemaps": "^1.5.2",
- "gulp-streamify": "1.0.2",
- "gulp-uglify": "^1.2.0",
- "gulp-util": "^3.0.6",
- "jasmine-core": "^2.3.4",
- "karma": "^1.2.0",
- "karma-coverage": "^1.0.0",
- "karma-jasmine": "^1.0.0",
- "karma-junit-reporter": "^1.0.0",
- "karma-mocha-reporter": "^2.0.0",
- "karma-notify-reporter": "^1.0.0",
- "karma-phantomjs-launcher": "^1.0.0",
- "karma-sourcemap-loader": "^0.3.6",
- "karma-webpack": "^1.7.0",
- "phantomjs-prebuilt": "^2.1.4",
- "ts-loader": "^1.3.3",
- "typescript": "^2.1.4",
- "webpack": "^1.12.2",
- "webpack-fail-plugin": "^1.0.4",
- "webpack-notifier": "^1.2.1"
- },
- "dependencies": {
- "babel-polyfill": "^6.0.0",
- "flux": "^2.0.3",
- "fbemitter": "^2.0.2",
- "react": "^15.4.1",
- "react-addons-test-utils": "^15.4.1",
- "react-dom": "^15.4.1"
- }
-}
diff --git a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/tsconfig.json b/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/tsconfig.json deleted file mode 100644 index c3a732c12..000000000 --- a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{
- "compileOnSave": false,
- "compilerOptions": {
- "allowSyntheticDefaultImports": true,
- "lib": [
- "dom",
- "es2015",
- "es2016"
- ],
- "jsx": "preserve",
- "target": "es2016",
- "module": "es2015",
- "moduleResolution": "node",
- "noImplicitAny": true,
- "noUnusedLocals": true,
- "noUnusedParameters": true,
- "removeComments": false,
- "preserveConstEnums": true,
- "sourceMap": true,
- "skipLibCheck": true
- }
-}
\ No newline at end of file diff --git a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/webpack.config.js b/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/webpack.config.js deleted file mode 100644 index cc26b27b7..000000000 --- a/node_modules/ts-loader/examples/webpack1/react-babel-karma-gulp/webpack.config.js +++ /dev/null @@ -1,43 +0,0 @@ -/* eslint-disable no-var, strict, prefer-arrow-callback */ -'use strict'; - -var path = require('path'); - -module.exports = { - cache: true, - entry: { - main: './src/main.tsx', - vendor: [ - 'babel-polyfill', - 'fbemitter', - 'flux', - 'react', - 'react-dom' - ] - }, - output: { - path: path.resolve(__dirname, './dist/scripts'), - filename: '[name].js', - chunkFilename: '[chunkhash].js' - }, - module: { - loaders: [{ - test: /\.ts(x?)$/, - exclude: /node_modules/, - loader: 'babel-loader?presets[]=es2016&presets[]=es2015&presets[]=react!ts-loader' - }, { - test: /\.js$/, - exclude: /node_modules/, - loader: 'babel', - query: { - presets: ['es2016', 'es2015', 'react'] - } - }] - }, - plugins: [ - ], - resolve: { - // Add `.ts` and `.tsx` as a resolvable extension. - extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js'] - }, -}; diff --git a/node_modules/ts-loader/index.js b/node_modules/ts-loader/index.js deleted file mode 100644 index 8a47bdc5c..000000000 --- a/node_modules/ts-loader/index.js +++ /dev/null @@ -1,3 +0,0 @@ -var loader = require('./dist'); - -module.exports = loader;
\ No newline at end of file diff --git a/node_modules/ts-loader/node_modules/.bin/semver b/node_modules/ts-loader/node_modules/.bin/semver deleted file mode 120000 index b3ca6032f..000000000 --- a/node_modules/ts-loader/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../../../semver/bin/semver
\ No newline at end of file diff --git a/node_modules/ts-loader/node_modules/loader-utils/CHANGELOG.md b/node_modules/ts-loader/node_modules/loader-utils/CHANGELOG.md deleted file mode 100644 index 30545e99f..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/CHANGELOG.md +++ /dev/null @@ -1,18 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -<a name="1.1.0"></a> -# [1.1.0](https://github.com/webpack/loader-utils/compare/v1.0.4...v1.1.0) (2017-03-16) - - -### Features - -* **automatic-release:** Generation of automatic release ([7484d13](https://github.com/webpack/loader-utils/commit/7484d13)) -* **parseQuery:** export parseQuery ([ddf64e4](https://github.com/webpack/loader-utils/commit/ddf64e4)) - - - -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. diff --git a/node_modules/ts-loader/node_modules/loader-utils/LICENSE b/node_modules/ts-loader/node_modules/loader-utils/LICENSE deleted file mode 100644 index 8c11fc728..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright JS Foundation and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ts-loader/node_modules/loader-utils/README.md b/node_modules/ts-loader/node_modules/loader-utils/README.md deleted file mode 100644 index 84bf788cc..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/README.md +++ /dev/null @@ -1,229 +0,0 @@ -# loader-utils - -## Methods - -### `getOptions` - -Recommended way to retrieve the options of a loader invocation: - -```javascript -// inside your loader -const options = loaderUtils.getOptions(this); -``` - -1. If `this.query` is a string: - - Tries to parse the query string and returns a new object - - Throws if it's not a valid query string -2. If `this.query` is object-like, it just returns `this.query` -3. In any other case, it just returns `null` - -**Please note:** The returned `options` object is *read-only*. It may be re-used across multiple invocations. -If you pass it on to another library, make sure to make a *deep copy* of it: - -```javascript -const options = Object.assign( - {}, - loaderUtils.getOptions(this), // it is safe to pass null to Object.assign() - defaultOptions -); -// don't forget nested objects or arrays -options.obj = Object.assign({}, options.obj); -options.arr = options.arr.slice(); -someLibrary(options); -``` - -[clone-deep](https://www.npmjs.com/package/clone-deep) is a good library to make a deep copy of the options. - -#### Options as query strings - -If the loader options have been passed as loader query string (`loader?some¶ms`), the string is parsed by using [`parseQuery`](#parsequery). - -### `parseQuery` - -Parses a passed string (e.g. `loaderContext.resourceQuery`) as a query string, and returns an object. - -``` javascript -const params = loaderUtils.parseQuery(this.resourceQuery); // resource: `file?param1=foo` -if (params.param1 === "foo") { - // do something -} -``` - -The string is parsed like this: - -``` text - -> Error -? -> {} -?flag -> { flag: true } -?+flag -> { flag: true } -?-flag -> { flag: false } -?xyz=test -> { xyz: "test" } -?xyz=1 -> { xyz: "1" } // numbers are NOT parsed -?xyz[]=a -> { xyz: ["a"] } -?flag1&flag2 -> { flag1: true, flag2: true } -?+flag1,-flag2 -> { flag1: true, flag2: false } -?xyz[]=a,xyz[]=b -> { xyz: ["a", "b"] } -?a%2C%26b=c%2C%26d -> { "a,&b": "c,&d" } -?{data:{a:1},isJSON5:true} -> { data: { a: 1 }, isJSON5: true } -``` - -### `stringifyRequest` - -Turns a request into a string that can be used inside `require()` or `import` while avoiding absolute paths. -Use it instead of `JSON.stringify(...)` if you're generating code inside a loader. - -**Why is this necessary?** Since webpack calculates the hash before module paths are translated into module ids, we must avoid absolute paths to ensure -consistent hashes across different compilations. - -This function: - -- resolves absolute requests into relative requests if the request and the module are on the same hard drive -- replaces `\` with `/` if the request and the module are on the same hard drive -- won't change the path at all if the request and the module are on different hard drives -- applies `JSON.stringify` to the result - -```javascript -loaderUtils.stringifyRequest(this, "./test.js"); -// "\"./test.js\"" - -loaderUtils.stringifyRequest(this, ".\\test.js"); -// "\"./test.js\"" - -loaderUtils.stringifyRequest(this, "test"); -// "\"test\"" - -loaderUtils.stringifyRequest(this, "test/lib/index.js"); -// "\"test/lib/index.js\"" - -loaderUtils.stringifyRequest(this, "otherLoader?andConfig!test?someConfig"); -// "\"otherLoader?andConfig!test?someConfig\"" - -loaderUtils.stringifyRequest(this, require.resolve("test")); -// "\"../node_modules/some-loader/lib/test.js\"" - -loaderUtils.stringifyRequest(this, "C:\\module\\test.js"); -// "\"../../test.js\"" (on Windows, in case the module and the request are on the same drive) - -loaderUtils.stringifyRequest(this, "C:\\module\\test.js"); -// "\"C:\\module\\test.js\"" (on Windows, in case the module and the request are on different drives) - -loaderUtils.stringifyRequest(this, "\\\\network-drive\\test.js"); -// "\"\\\\network-drive\\\\test.js\"" (on Windows, in case the module and the request are on different drives) -``` - -### `urlToRequest` - -Converts some resource URL to a webpack module request. - -```javascript -const url = "path/to/module.js"; -const request = loaderUtils.urlToRequest(url); // "./path/to/module.js" -``` - -#### Module URLs - -Any URL containing a `~` will be interpreted as a module request. Anything after the `~` will be considered the request path. - -```javascript -const url = "~path/to/module.js"; -const request = loaderUtils.urlToRequest(url); // "path/to/module.js" -``` - -#### Root-relative URLs - -URLs that are root-relative (start with `/`) can be resolved relative to some arbitrary path by using the `root` parameter: - -```javascript -const url = "/path/to/module.js"; -const root = "./root"; -const request = loaderUtils.urlToRequest(url, root); // "./root/path/to/module.js" -``` - -To convert a root-relative URL into a module URL, specify a `root` value that starts with `~`: - -```javascript -const url = "/path/to/module.js"; -const root = "~"; -const request = loaderUtils.urlToRequest(url, root); // "path/to/module.js" -``` - -### `interpolateName` - -Interpolates a filename template using multiple placeholders and/or a regular expression. -The template and regular expression are set as query params called `name` and `regExp` on the current loader's context. - -```javascript -const interpolatedName = loaderUtils.interpolateName(loaderContext, name, options); -``` - -The following tokens are replaced in the `name` parameter: - -* `[ext]` the extension of the resource -* `[name]` the basename of the resource -* `[path]` the path of the resource relative to the `context` query parameter or option. -* `[folder]` the folder of the resource is in. -* `[emoji]` a random emoji representation of `options.content` -* `[emoji:<length>]` same as above, but with a customizable number of emojis -* `[hash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the md5 hash) -* `[<hashType>:hash:<digestType>:<length>]` optionally one can configure - * other `hashType`s, i. e. `sha1`, `md5`, `sha256`, `sha512` - * other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64` - * and `length` the length in chars -* `[N]` the N-th match obtained from matching the current file name against `options.regExp` - -Examples - -``` javascript -// loaderContext.resourcePath = "/app/js/javascript.js" -loaderUtils.interpolateName(loaderContext, "js/[hash].script.[ext]", { content: ... }); -// => js/9473fdd0d880a43c21b7778d34872157.script.js - -// loaderContext.resourcePath = "/app/page.html" -loaderUtils.interpolateName(loaderContext, "html-[hash:6].html", { content: ... }); -// => html-9473fd.html - -// loaderContext.resourcePath = "/app/flash.txt" -loaderUtils.interpolateName(loaderContext, "[hash]", { content: ... }); -// => c31e9820c001c9c4a86bce33ce43b679 - -// loaderContext.resourcePath = "/app/img/image.gif" -loaderUtils.interpolateName(loaderContext, "[emoji]", { content: ... }); -// => ๐ - -// loaderContext.resourcePath = "/app/img/image.gif" -loaderUtils.interpolateName(loaderContext, "[emoji:4]", { content: ... }); -// => ๐๐ข๐ค๐ - -// loaderContext.resourcePath = "/app/img/image.png" -loaderUtils.interpolateName(loaderContext, "[sha512:hash:base64:7].[ext]", { content: ... }); -// => 2BKDTjl.png -// use sha512 hash instead of md5 and with only 7 chars of base64 - -// loaderContext.resourcePath = "/app/img/myself.png" -// loaderContext.query.name = -loaderUtils.interpolateName(loaderContext, "picture.png"); -// => picture.png - -// loaderContext.resourcePath = "/app/dir/file.png" -loaderUtils.interpolateName(loaderContext, "[path][name].[ext]?[hash]", { content: ... }); -// => /app/dir/file.png?9473fdd0d880a43c21b7778d34872157 - -// loaderContext.resourcePath = "/app/js/page-home.js" -loaderUtils.interpolateName(loaderContext, "script-[1].[ext]", { regExp: "page-(.*)\\.js", content: ... }); -// => script-home.js -``` - -### `getHashDigest` - -``` javascript -const digestString = loaderUtils.getHashDigest(buffer, hashType, digestType, maxLength); -``` - -* `buffer` the content that should be hashed -* `hashType` one of `sha1`, `md5`, `sha256`, `sha512` or any other node.js supported hash type -* `digestType` one of `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64` -* `maxLength` the maximum length in chars - -## License - -MIT (http://www.opensource.org/licenses/mit-license.php) diff --git a/node_modules/ts-loader/node_modules/loader-utils/lib/getCurrentRequest.js b/node_modules/ts-loader/node_modules/loader-utils/lib/getCurrentRequest.js deleted file mode 100644 index f05e112ac..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/lib/getCurrentRequest.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -function getCurrentRequest(loaderContext) { - if(loaderContext.currentRequest) - return loaderContext.currentRequest; - const request = loaderContext.loaders - .slice(loaderContext.loaderIndex) - .map(obj => obj.request) - .concat([loaderContext.resource]); - return request.join("!"); -} - -module.exports = getCurrentRequest; diff --git a/node_modules/ts-loader/node_modules/loader-utils/lib/getHashDigest.js b/node_modules/ts-loader/node_modules/loader-utils/lib/getHashDigest.js deleted file mode 100644 index 6f4a427e5..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/lib/getHashDigest.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; - -const baseEncodeTables = { - 26: "abcdefghijklmnopqrstuvwxyz", - 32: "123456789abcdefghjkmnpqrstuvwxyz", // no 0lio - 36: "0123456789abcdefghijklmnopqrstuvwxyz", - 49: "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no lIO - 52: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - 58: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no 0lIO - 62: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - 64: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_" -}; - -function encodeBufferToBase(buffer, base) { - const encodeTable = baseEncodeTables[base]; - if(!encodeTable) throw new Error("Unknown encoding base" + base); - - const readLength = buffer.length; - - const Big = require("big.js"); - Big.RM = Big.DP = 0; - let b = new Big(0); - for(let i = readLength - 1; i >= 0; i--) { - b = b.times(256).plus(buffer[i]); - } - - let output = ""; - while(b.gt(0)) { - output = encodeTable[b.mod(base)] + output; - b = b.div(base); - } - - Big.DP = 20; - Big.RM = 1; - - return output; -} - -function getHashDigest(buffer, hashType, digestType, maxLength) { - hashType = hashType || "md5"; - maxLength = maxLength || 9999; - const hash = require("crypto").createHash(hashType); - hash.update(buffer); - if(digestType === "base26" || digestType === "base32" || digestType === "base36" || - digestType === "base49" || digestType === "base52" || digestType === "base58" || - digestType === "base62" || digestType === "base64") { - return encodeBufferToBase(hash.digest(), digestType.substr(4)).substr(0, maxLength); - } else { - return hash.digest(digestType || "hex").substr(0, maxLength); - } -} - -module.exports = getHashDigest; diff --git a/node_modules/ts-loader/node_modules/loader-utils/lib/getOptions.js b/node_modules/ts-loader/node_modules/loader-utils/lib/getOptions.js deleted file mode 100644 index 24bcae47b..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/lib/getOptions.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -const parseQuery = require("./parseQuery"); - -function getOptions(loaderContext) { - const query = loaderContext.query; - if(typeof query === "string" && query !== "") { - return parseQuery(loaderContext.query); - } - if(!query || typeof query !== "object") { - // Not object-like queries are not supported. - return null; - } - return query; -} - -module.exports = getOptions; diff --git a/node_modules/ts-loader/node_modules/loader-utils/lib/getRemainingRequest.js b/node_modules/ts-loader/node_modules/loader-utils/lib/getRemainingRequest.js deleted file mode 100644 index f48c71a49..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/lib/getRemainingRequest.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -function getRemainingRequest(loaderContext) { - if(loaderContext.remainingRequest) - return loaderContext.remainingRequest; - const request = loaderContext.loaders - .slice(loaderContext.loaderIndex + 1) - .map(obj => obj.request) - .concat([loaderContext.resource]); - return request.join("!"); -} - -module.exports = getRemainingRequest; diff --git a/node_modules/ts-loader/node_modules/loader-utils/lib/index.js b/node_modules/ts-loader/node_modules/loader-utils/lib/index.js deleted file mode 100644 index a5950922f..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/lib/index.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -const getOptions = require("./getOptions"); -const parseQuery = require("./parseQuery"); -const stringifyRequest = require("./stringifyRequest"); -const getRemainingRequest = require("./getRemainingRequest"); -const getCurrentRequest = require("./getCurrentRequest"); -const isUrlRequest = require("./isUrlRequest"); -const urlToRequest = require("./urlToRequest"); -const parseString = require("./parseString"); -const getHashDigest = require("./getHashDigest"); -const interpolateName = require("./interpolateName"); - -exports.getOptions = getOptions; -exports.parseQuery = parseQuery; -exports.stringifyRequest = stringifyRequest; -exports.getRemainingRequest = getRemainingRequest; -exports.getCurrentRequest = getCurrentRequest; -exports.isUrlRequest = isUrlRequest; -exports.urlToRequest = urlToRequest; -exports.parseString = parseString; -exports.getHashDigest = getHashDigest; -exports.interpolateName = interpolateName; diff --git a/node_modules/ts-loader/node_modules/loader-utils/lib/interpolateName.js b/node_modules/ts-loader/node_modules/loader-utils/lib/interpolateName.js deleted file mode 100644 index 5e5b65326..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/lib/interpolateName.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; - -const path = require("path"); -const emojisList = require("emojis-list"); -const getHashDigest = require("./getHashDigest"); - -const emojiRegex = /[\uD800-\uDFFF]./; -const emojiList = emojisList.filter(emoji => emojiRegex.test(emoji)); -const emojiCache = {}; - -function encodeStringToEmoji(content, length) { - if(emojiCache[content]) return emojiCache[content]; - length = length || 1; - const emojis = []; - do { - const index = Math.floor(Math.random() * emojiList.length); - emojis.push(emojiList[index]); - emojiList.splice(index, 1); - } while(--length > 0); - const emojiEncoding = emojis.join(""); - emojiCache[content] = emojiEncoding; - return emojiEncoding; -} - -function interpolateName(loaderContext, name, options) { - let filename; - if(typeof name === "function") { - filename = name(loaderContext.resourcePath); - } else { - filename = name || "[hash].[ext]"; - } - const context = options.context; - const content = options.content; - const regExp = options.regExp; - let ext = "bin"; - let basename = "file"; - let directory = ""; - let folder = ""; - if(loaderContext.resourcePath) { - const parsed = path.parse(loaderContext.resourcePath); - let resourcePath = loaderContext.resourcePath; - - if(parsed.ext) { - ext = parsed.ext.substr(1); - } - if(parsed.dir) { - basename = parsed.name; - resourcePath = parsed.dir + path.sep; - } - if(typeof context !== "undefined") { - directory = path.relative(context, resourcePath + "_").replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1"); - directory = directory.substr(0, directory.length - 1); - } else { - directory = resourcePath.replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1"); - } - if(directory.length === 1) { - directory = ""; - } else if(directory.length > 1) { - folder = path.basename(directory); - } - } - let url = filename; - if(content) { - // Match hash template - url = url - .replace( - /\[(?:(\w+):)?hash(?::([a-z]+\d*))?(?::(\d+))?\]/ig, - (all, hashType, digestType, maxLength) => getHashDigest(content, hashType, digestType, parseInt(maxLength, 10)) - ) - .replace( - /\[emoji(?::(\d+))?\]/ig, - (all, length) => encodeStringToEmoji(content, length) - ); - } - url = url - .replace(/\[ext\]/ig, () => ext) - .replace(/\[name\]/ig, () => basename) - .replace(/\[path\]/ig, () => directory) - .replace(/\[folder\]/ig, () => folder); - if(regExp && loaderContext.resourcePath) { - const match = loaderContext.resourcePath.match(new RegExp(regExp)); - match && match.forEach((matched, i) => { - url = url.replace( - new RegExp("\\[" + i + "\\]", "ig"), - matched - ); - }); - } - if(typeof loaderContext.options === "object" && typeof loaderContext.options.customInterpolateName === "function") { - url = loaderContext.options.customInterpolateName.call(loaderContext, url, name, options); - } - return url; -} - -module.exports = interpolateName; diff --git a/node_modules/ts-loader/node_modules/loader-utils/lib/isUrlRequest.js b/node_modules/ts-loader/node_modules/loader-utils/lib/isUrlRequest.js deleted file mode 100644 index bee968ee8..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/lib/isUrlRequest.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -function isUrlRequest(url, root) { - // An URL is not an request if - // 1. it's a Data Url - // 2. it's an absolute url or and protocol-relative - // 3. it's some kind of url for a template - if(/^data:|^chrome-extension:|^(https?:)?\/\/|^[\{\}\[\]#*;,'ยง\$%&\(=?`ยด\^ยฐ<>]/.test(url)) return false; - // 4. It's also not an request if root isn't set and it's a root-relative url - if((root === undefined || root === false) && /^\//.test(url)) return false; - return true; -} - -module.exports = isUrlRequest; diff --git a/node_modules/ts-loader/node_modules/loader-utils/lib/parseQuery.js b/node_modules/ts-loader/node_modules/loader-utils/lib/parseQuery.js deleted file mode 100644 index 5748cded8..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/lib/parseQuery.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; - -const JSON5 = require("json5"); - -const specialValues = { - "null": null, - "true": true, - "false": false -}; - -function parseQuery(query) { - if(query.substr(0, 1) !== "?") { - throw new Error("A valid query string passed to parseQuery should begin with '?'"); - } - query = query.substr(1); - if(!query) { - return {}; - } - if(query.substr(0, 1) === "{" && query.substr(-1) === "}") { - return JSON5.parse(query); - } - const queryArgs = query.split(/[,&]/g); - const result = {}; - queryArgs.forEach(arg => { - const idx = arg.indexOf("="); - if(idx >= 0) { - let name = arg.substr(0, idx); - let value = decodeURIComponent(arg.substr(idx + 1)); - if(specialValues.hasOwnProperty(value)) { - value = specialValues[value]; - } - if(name.substr(-2) === "[]") { - name = decodeURIComponent(name.substr(0, name.length - 2)); - if(!Array.isArray(result[name])) - result[name] = []; - result[name].push(value); - } else { - name = decodeURIComponent(name); - result[name] = value; - } - } else { - if(arg.substr(0, 1) === "-") { - result[decodeURIComponent(arg.substr(1))] = false; - } else if(arg.substr(0, 1) === "+") { - result[decodeURIComponent(arg.substr(1))] = true; - } else { - result[decodeURIComponent(arg)] = true; - } - } - }); - return result; -} - -module.exports = parseQuery; diff --git a/node_modules/ts-loader/node_modules/loader-utils/lib/parseString.js b/node_modules/ts-loader/node_modules/loader-utils/lib/parseString.js deleted file mode 100644 index ca69dfd06..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/lib/parseString.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -function parseString(str) { - try { - if(str[0] === "\"") return JSON.parse(str); - if(str[0] === "'" && str.substr(str.length - 1) === "'") { - return parseString( - str - .replace(/\\.|"/g, x => x === "\"" ? "\\\"" : x) - .replace(/^'|'$/g, "\"") - ); - } - return JSON.parse("\"" + str + "\""); - } catch(e) { - return str; - } -} - -module.exports = parseString; diff --git a/node_modules/ts-loader/node_modules/loader-utils/lib/stringifyRequest.js b/node_modules/ts-loader/node_modules/loader-utils/lib/stringifyRequest.js deleted file mode 100644 index 46e9ae2e9..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/lib/stringifyRequest.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; - -const path = require("path"); - -const matchRelativePath = /^\.\.?[/\\]/; - -function isAbsolutePath(str) { - return path.posix.isAbsolute(str) || path.win32.isAbsolute(str); -} - -function isRelativePath(str) { - return matchRelativePath.test(str); -} - -function stringifyRequest(loaderContext, request) { - const splitted = request.split("!"); - const context = loaderContext.context || (loaderContext.options && loaderContext.options.context); - return JSON.stringify(splitted.map(part => { - // First, separate singlePath from query, because the query might contain paths again - const splittedPart = part.match(/^(.*?)(\?.*)/); - let singlePath = splittedPart ? splittedPart[1] : part; - const query = splittedPart ? splittedPart[2] : ""; - if(isAbsolutePath(singlePath) && context) { - singlePath = path.relative(context, singlePath); - if(isAbsolutePath(singlePath)) { - // If singlePath still matches an absolute path, singlePath was on a different drive than context. - // In this case, we leave the path platform-specific without replacing any separators. - // @see https://github.com/webpack/loader-utils/pull/14 - return singlePath + query; - } - if(isRelativePath(singlePath) === false) { - // Ensure that the relative path starts at least with ./ otherwise it would be a request into the modules directory (like node_modules). - singlePath = "./" + singlePath; - } - } - return singlePath.replace(/\\/g, "/") + query; - }).join("!")); -} - -module.exports = stringifyRequest; diff --git a/node_modules/ts-loader/node_modules/loader-utils/lib/urlToRequest.js b/node_modules/ts-loader/node_modules/loader-utils/lib/urlToRequest.js deleted file mode 100644 index 06c3cd046..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/lib/urlToRequest.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; - -// we can't use path.win32.isAbsolute because it also matches paths starting with a forward slash -const matchNativeWin32Path = /^[A-Z]:[/\\]|^\\\\/i; - -function urlToRequest(url, root) { - const moduleRequestRegex = /^[^?]*~/; - let request; - - if(matchNativeWin32Path.test(url)) { - // absolute windows path, keep it - request = url; - } else if(root !== undefined && root !== false && /^\//.test(url)) { - // if root is set and the url is root-relative - switch(typeof root) { - // 1. root is a string: root is prefixed to the url - case "string": - // special case: `~` roots convert to module request - if(moduleRequestRegex.test(root)) { - request = root.replace(/([^~\/])$/, "$1/") + url.slice(1); - } else { - request = root + url; - } - break; - // 2. root is `true`: absolute paths are allowed - // *nix only, windows-style absolute paths are always allowed as they doesn't start with a `/` - case "boolean": - request = url; - break; - default: - throw new Error("Unexpected parameters to loader-utils 'urlToRequest': url = " + url + ", root = " + root + "."); - } - } else if(/^\.\.?\//.test(url)) { - // A relative url stays - request = url; - } else { - // every other url is threaded like a relative url - request = "./" + url; - } - - // A `~` makes the url an module - if(moduleRequestRegex.test(request)) { - request = request.replace(moduleRequestRegex, ""); - } - - return request; -} - -module.exports = urlToRequest; diff --git a/node_modules/ts-loader/node_modules/loader-utils/node_modules/.bin/json5 b/node_modules/ts-loader/node_modules/loader-utils/node_modules/.bin/json5 deleted file mode 120000 index 09cacab1f..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/node_modules/.bin/json5 +++ /dev/null @@ -1 +0,0 @@ -../../../../../json5/lib/cli.js
\ No newline at end of file diff --git a/node_modules/ts-loader/node_modules/loader-utils/package.json b/node_modules/ts-loader/node_modules/loader-utils/package.json deleted file mode 100644 index a547e2347..000000000 --- a/node_modules/ts-loader/node_modules/loader-utils/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "loader-utils", - "version": "1.1.0", - "author": "Tobias Koppers @sokra", - "description": "utils for webpack loaders", - "dependencies": { - "big.js": "^3.1.3", - "emojis-list": "^2.0.0", - "json5": "^0.5.0" - }, - "scripts": { - "test": "mocha", - "posttest": "npm run lint", - "lint": "eslint lib test", - "travis": "npm run cover -- --report lcovonly", - "cover": "istanbul cover -x *.runtime.js node_modules/mocha/bin/_mocha", - "release": "npm test && standard-version" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/webpack/loader-utils.git" - }, - "engines": { - "node": ">=4.0.0" - }, - "devDependencies": { - "coveralls": "^2.11.2", - "eslint": "^3.15.0", - "eslint-plugin-node": "^4.0.1", - "istanbul": "^0.3.14", - "mocha": "^1.21.4", - "standard-version": "^4.0.0" - }, - "main": "lib/index.js", - "files": [ - "lib" - ] -} diff --git a/node_modules/ts-loader/package.json b/node_modules/ts-loader/package.json deleted file mode 100644 index 3951d12e7..000000000 --- a/node_modules/ts-loader/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{
- "name": "ts-loader",
- "version": "2.1.0",
- "description": "TypeScript loader for webpack",
- "main": "index.js",
- "scripts": {
- "build": "tsc --version && tsc --project \"./src\"",
- "comparison-tests": "npm link ./test/comparison-tests/testLib && node test/comparison-tests/run-tests.js",
- "comparison-tests-generate": "node test/comparison-tests/stub-new-version.js",
- "execution-tests": "node test/execution-tests/run-tests.js",
- "test": "node test/run-tests.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/TypeStrong/ts-loader.git"
- },
- "keywords": [
- "ts-loader",
- "typescript-loader",
- "webpack",
- "loader",
- "typescript",
- "ts"
- ],
- "engines": {
- "node": ">=4.3.0 <5.0.0 || >=5.10"
- },
- "author": "James Brantly <james@jbrantly.com> (http://www.jbrantly.com/)",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/TypeStrong/ts-loader/issues"
- },
- "homepage": "https://github.com/TypeStrong/ts-loader",
- "dependencies": {
- "colors": "^1.0.3",
- "enhanced-resolve": "^3.0.0",
- "loader-utils": "^1.0.2",
- "semver": "^5.0.1"
- },
- "devDependencies": {
- "babel": "^6.0.0",
- "babel-core": "^6.0.0",
- "babel-loader": "^7.0.0",
- "babel-polyfill": "^6.16.0",
- "babel-preset-es2015": "^6.0.0",
- "babel-preset-es2016": "^6.16.0",
- "babel-preset-react": "^6.0.0",
- "escape-string-regexp": "^1.0.3",
- "fs-extra": "^3.0.0",
- "glob": "^7.1.1",
- "happypack": "^3.1.0",
- "html-webpack-plugin": "^2.17.0",
- "jasmine-core": "^2.5.2",
- "karma": "^1.3.0",
- "karma-jasmine": "^1.0.0",
- "karma-mocha-reporter": "^2.0.0",
- "karma-phantomjs-launcher": "^1.0.0",
- "karma-sourcemap-loader": "^0.3.6",
- "karma-webpack": "^2.0.1",
- "mkdirp": "^0.5.1",
- "mocha": "^3.1.0",
- "phantomjs-prebuilt": "^2.1.2",
- "rimraf": "^2.4.2",
- "typescript": "^2.2.1",
- "typings": "^2.0.0",
- "webpack": "^2.2.0"
- }
-}
|