Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
awesome-typescript-loader
Advanced tools
TypeScript loader for Webpack. This project was started as a fork of https://github.com/andreypopp/typescript-loader. Thanks @andreypopp for the great project.
The main goal of this loader is to support the watch mode and webpack-dev-server with incremental compilation. Also there are a lot of problems in other TypeScript loaders that were fixed here.
Right now this library works only with the TypeScript 1.5-beta compiler.
npm install awesome-typescript-loader --save-dev
.ts
as a resolvable extension..ts
extension to be handled by awesome-typescript-loader
.webpack.config.js
module.exports = {
// Currently we need to add '.ts' to resolve.extensions array.
resolve: {
extensions: ['', '.ts', '.webpack.js', '.web.js', '.js']
},
// Source maps support (or 'inline-source-map' also works)
devtool: 'source-map',
// Add loader for .ts files.
module: {
loaders: [
{
test: /\.ts$/,
loader: 'awesome-typescript-loader'
}
]
}
};
After that, you would be able to build TypeScript files with webpack.
Specify the TypeScript output target.
Specify the type of modules that TypeScript emits.
Specify whether or not TypeScript emits source maps.
Specify whether or not TypeScript will allow inferring the any
type.
Allows use of TypeScript compilers other than the official one. Should be set to the NPM name of the compiler.
Specify whether or not the loader emits webpacks's require type. You might use emitRequireType=false
with Node, because it already has own require type in node.d.ts
file.
Allows use of library other than the target
's default one. Useful when you want to use ES6 library with ES5 target. Also you might use library=es6
with Node.
Allows to use several TypeScript compilers with different settings in one app. Just override instanceName
to initialize another instance.
Collect files dependency graph and re-emit all dependent files along with changed file.
This loader has support of both --watch
and webpack-dev-server
modes. It handles file dependencies
using internal webpack dependency markers. When you change a file, the loader recompiles all dependencies.
The most natural way to structure your code with TypeScript and webpack is to use external modules, and these work as you would expect.
npm install --save react
import React = require('react');
This project doesn't aim to support internal modules, because it's hard to resolve dependencies for the watch mode if you use such modules. Of course, you can still use them without watch, but this function is unstable.
All declaration files should be resolvable from the entry file.
The easiest way to do this is to create a references.d.ts
file which contains
references to all of your declaration files. Then reference
references.d.ts
from your entry file.
FAQs
Awesome TS loader for webpack
The npm package awesome-typescript-loader receives a total of 92,158 weekly downloads. As such, awesome-typescript-loader popularity was classified as popular.
We found that awesome-typescript-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.