Skip to content

a tsickle webpack loader (for using ADVANCED closure compiler optimizations)

License

Notifications You must be signed in to change notification settings

AppMonet/tsickle-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@appmonet/tsickle-loader

This is a webpack loader for 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 directory for an example of compiling this way.

usage

You can use this like any normal webpack loader; it takes a some options:

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 and import the build library as javascript from ./lib -- all tests use ./test/compiler.js

About

a tsickle webpack loader (for using ADVANCED closure compiler optimizations)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published