https://github.com/appmonet/tsickle-loader
a tsickle webpack loader (for using ADVANCED closure compiler optimizations)
https://github.com/appmonet/tsickle-loader
build-tools closure-compiler tsickle webpack-loader
Last synced: about 2 months ago
JSON representation
a tsickle webpack loader (for using ADVANCED closure compiler optimizations)
- Host: GitHub
- URL: https://github.com/appmonet/tsickle-loader
- Owner: AppMonet
- License: mit
- Created: 2019-02-05T23:11:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T02:40:53.000Z (over 2 years ago)
- Last Synced: 2025-03-27T11:02:40.330Z (2 months ago)
- Topics: build-tools, closure-compiler, tsickle, webpack-loader
- Language: TypeScript
- Size: 1.03 MB
- Stars: 28
- Watchers: 1
- Forks: 6
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @appmonet/tsickle-loader
This is a webpack loader for [tsickle](https://github.com/angular/tsickle); it lets us compile typescript code with the `typescript` compilaer, while adding annotations & externs readable by closure compiler, which means we can use `ADVANCED_OPTIMIZATIONS` mode. See the [`test`](/test/compiler.js) directory for an example of compiling this way.
## usage
You can use this like any normal webpack loader; it takes a some options:
```javascript
module.exports = {
module: {
rules: [
{
// you use tsickle-loader in place of typescript-loader;
// it will compile for you using typescript
test: /\.ts$/,
use: {
loader: "tsickle-loader",
options: {
// the tsconfig file to use during compilation
tsconfig: path.resolve(__dirname, "tsconfig.json"),
// this is the directory where externs will be saved. You
// will probably want to delete these between builds
externDir: "./tmp/externs"
}
}
}
]
}
};
```## development
To build this project:
- install dependencies `yarn install`
- build the loader `yarn build`
- run tests `yarn test`Tests use [jest](https://jestjs.io/) and import the build library as javascript from `./lib` -- all tests use [`./test/compiler.js`](test/compiler.js)