Skip to content

waysact/webpack-closure-compiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-closure-compiler

Google Closure Compiler plugin for Webpack

WIP

Webpack Closure Compiler logo

Installation

npm i -D webpack-closure-compiler

Usage

Options

language_in

Specifies input language, possible values are:

  • ECMASCRIPT3 (default)
  • ECMASCRIPT5
  • ECMASCRIPT5_STRICT
  • ECMASCRIPT6
  • ECMASCRIPT6_STRICT
  • ECMASCRIPT6_TYPED (experimental)

language_out

Specifies output language, possible values are:

(defaults to the value of language_in)

  • ECMASCRIPT3
  • ECMASCRIPT5
  • ECMASCRIPT5_STRICT
  • ECMASCRIPT6_TYPED (experimental)

compilation_level

Specifies the compilation level, possible values are:

  • WHITESPACE_ONLY
  • SIMPLE
  • ADVANCED

What to Watch Out for When Using ADVANCED_OPTIMIZATIONS

var path = require('path');
var ClosureCompilerPlugin = require('webpack-closure-compiler');

module.exports = {

    entry: [
        path.join(__dirname, 'app.js')
    ],
    module: {
        loaders: [
            { test: /\.js$/, exclude: /node_modules/, loaders: ['babel-loader?optional=runtime&stage=0&cacheDirectory'] }
        ]
    },
    output: {
        path: path.join(__dirname, '/'),
        filename: 'app.min.js'
    },
    plugins: [
        new ClosureCompilerPlugin({
          language_in: 'ECMASCRIPT6',
          language_out: 'ECMASCRIPT5',
          compilation_level: 'ADVANCED'
        })
    ]
};

About

Google Closure Compiler plugin for Webpack [WIP]

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%