Git Product home page Git Product logo

snowpack-plugin-closure-compiler's Introduction

npm size libera manifesto

snowpack-plugin-closure-compiler

Snowpack plugin that processes JavaScript assets through the Closure Compiler, reducing file sizes and performing static code analysis.

Requirements

This plugin requires an LTS Node version (v8.0.0+) and Snowpack v2.0.0+.

Install

Using npm:

npm install --save-dev snowpack-plugin-closure-compiler

Usage

Create a snowpack.config.js configuration file and import the plugin:

const dsv = require('snowpack-plugin-dsv');

module.exports = {
  mount: {
    public: { url: '/', static: true },
    src: { url: '/dist' },
  },
  plugins: ['snowpack-plugin-closure-compiler', {
    compilationLevel: "SIMPLE",
    outputFile: "main.js",
    bundle: false
  }],
};

Options

bundle

Type: boolean
Default: true

The Closure Compiler can bundle all JavaScript files into and this is the default processing for the plugin. If JavaScript files need to not be bundled, use false.

outputFile

Type: string
Default: index.js

Specify resource name after compilation, placed inside of mount.src.url directory.

compilationLevel

Type: string
Default: SIMPLE

Determines type of processing performed by Closure Compiler - specify one of BUNDLE, WHITESPACE_ONLY, SIMPLE, ADVANCED

languageIn

Type: string
Default: ECMASCRIPT_NEXT

Specifies what the most recent level of ECMAScript used in the source code. One of the following: ECMASCRIPT3, ECMASCRIPT5, ECMASCRIPT5_STRICT, ECMASCRIPT_2015, ECMASCRIPT_2016, ECMASCRIPT_2017, ECMASCRIPT_2018, ECMASCRIPT_2019, STABLE, ECMASCRIPT_NEXT

languageOut

Type: string
Default: ECMASCRIPT5

Determines ECMAScript version of output file - use one of the values referenced in the languageIn property.

Meta

LICENSE (MIT)

snowpack-plugin-closure-compiler's People

Contributors

dependabot[bot] avatar sam-parsons avatar

Stargazers

 avatar  avatar

Watchers

 avatar

snowpack-plugin-closure-compiler's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.