Dominator008 / webpack-closure-compiler

Google Closure Compiler plugin for Webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webpack-closure-compiler

Google Closure Compiler plugin for Webpack

Webpack Closure Compiler logo

Installation

npm i -D webpack-closure-compiler

Usage

Options

compiler

A hash of options to pass to google-closure-compiler.

concurrency

The maximum number of compiler instances to run in parallel, defaults to 1.

test

Process only files which filename satisfies specified RegExp, defaults to /\.js($|\?)/i.

Example

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({
          compiler: {
            language_in: 'ECMASCRIPT6',
            language_out: 'ECMASCRIPT5',
            compilation_level: 'ADVANCED'
          },
          concurrency: 3,
        })
    ]
};

License

MIT

About

Google Closure Compiler plugin for Webpack

License:MIT License


Languages

Language:JavaScript 99.7%Language:CSS 0.3%