Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

polymer-build

Polymer18.4kBSD-3-Clause3.1.4TypeScript support: included

A library of Gulp build tasks

readme

Build Status NPM version

Polymer Build

polymer-build is a library for building Polymer projects.

Installation

npm install --save-dev polymer-build

Relationship to Polymer CLI

The Polymer CLI uses polymer-build under the hood, so you can think of the CLI's build command like running a pre-configured polymer-build pipeline. Setting this up for you makes the CLI easy to use, but as a command-line wrapper its customization options are more limited. polymer-build allows you to completely customize your build and combine additional streams and build tasks in any order.

Consider using polymer-build instead of the CLI if you:

  • Want to customize your build(s) without using the Polymer CLI
  • Need to run your source code through custom optimizers/processors before, after, or during your build
  • Need to hook additional work into any part of the build process

Usage

While polymer-build was built to work easily with Gulp, it can be used in any Node.js environment. polymer-build is built on Node.js streams, and the build pipeline that you create with it is not much more than a series of connected streams. Files are represented as Vinyl file objects, which means that polymer-build can interop with any existing Gulp/Vinyl streams.

Check out the custom-build generator for an example of how polymer-build can be used to build a project.

PolymerProject

PolymerProject represents your project in the build pipeline. Once configured, it will give you access to a collection of streams and helpers for building your project.

To create a new instance of PolymerProject, you'll need to give it some information about your application. If you already have a polymer.json configuration file in your project, you can create a new PolymerProject instance by loading it directly:

const PolymerProject = require('polymer-build').PolymerProject;

const project = new PolymerProject(require('./polymer.json'));

Or, you can pass in configuration options directly to the PolymerProject constructor:

const PolymerProject = require('polymer-build').PolymerProject;

const project = new PolymerProject({
  entrypoint: 'index.html',
  shell: 'src/my-app.js',
  fragments: [
    'src/my-view1.js',
    'src/my-view2.js',
    'src/my-view3.js'
  ]
});

project.sources()

Returns a readable stream of your project's source files. By default, these are the files in your project's src/ directory, but if you have additional source files this can be configured via the sources property in ProjectOptions.

project.dependencies()

Returns a readable stream of your project's dependencies. This stream is automatically populated based on the files loaded inside of your project. You can include additional dependencies via the extraDependencies property in ProjectOptions (this can be useful when the analyzer fails to detect a necessary dependency.)

const gulp = require('gulp');
const mergeStream = require('merge-stream');

// Create a build pipeline to pipe both streams together to the 'build/' dir
mergeStream(project.sources(), project.dependencies())
  .pipe(gulp.dest('build/'));

Handling Inlined CSS/JS

HtmlSplitter

Web components will sometimes include inlined CSS & JavaScript. This can pose a problem for tools that weren't built to read those languages from inside HTML. To solve this, you can create an HtmlSplitter instance to extract inlined CSS & JavaScript into individual files in your build stream for processing (and then rejoin them later).

const gulpif = require('gulp-if');
const uglify = require('gulp-uglify');
const cssSlam = require('css-slam').gulp;
const htmlMinifier = require('gulp-html-minifier');
const HtmlSplitter = require('polymer-build').HtmlSplitter;

const sourcesHtmlSplitter = new HtmlSplitter();
const sourcesStream = project.sources()
  .pipe(sourcesHtmlSplitter.split()) // split inline JS & CSS out into individual .js & .css files
  .pipe(gulpif(/\.js$/, uglify()))
  .pipe(gulpif(/\.css$/, cssSlam()))
  .pipe(gulpif(/\.html$/, htmlMinifier()))
  .pipe(sourcesHtmlSplitter.rejoin()); // rejoins those files back into their original location

// NOTE: If you want to split/rejoin your dependencies stream as well, you'll need to create a new HtmlSplitter for that stream.

You can add splitters to any part of your build stream. We recommend using them to optimize your sources() and dependencies() streams individually as in the example above, but you can also optimize after merging the two together or even after bundling.

Bundling Files

project.bundler()

A stream that combines seperate files into code bundles based on your application's dependency graph. This can be a great way to improve performance by reducing the number of frontend requests needed.

By default, the bundler will create one "shared-bundle.html" containing all shared dependencies. You can optimize even further by defining "fragments" in your project options. Fragments are lazy loaded parts of the application, typically views and other elements loaded on-demand. When fragments are defined, the bundler is able to create smaller bundles containing code that is only required for specific fragments.

const gulp = require('gulp');
const mergeStream = require('merge-stream');

// Create a build pipeline to bundle our application before writing to the 'build/' dir
mergeStream(project.sources(), project.dependencies())
  .pipe(project.bundler())
  .pipe(gulp.dest('build/'));

The bundler() method accepts an options object to configure bundling. See Using polymer-bundler programmatically for a detailed list of accepted options.

const {generateCountingSharedBundleUrlMapper,
       generateSharedDepsMergeStrategy} = require('polymer-bundler');

mergeStream(project.sources(), project.dependencies())
  .pipe(project.bundler({
    excludes: ['bower_components/polymer-code-mirror'],
    sourcemaps: true,
    stripComments: true,
    strategy: generateSharedDepsMergeStrategy(3),
    urlMapper: generateCountingSharedBundleUrlMapper('shared/bundle_')
  }))
  .pipe(gulp.dest('build/'));

NOTE: When working programmatically with Bundler, Polymer 1.x projects should include rewriteUrlsInTemplates: true when their projects rely on custom element definitions which use relative paths inside style tags and element attributes. Polymer 2.x uses the assetpath property added to dom-modules during bundling to resolve relative urls in style tags and provides the importPath binding to prefix relative paths in templates.

Generating a Service Worker

generateServiceWorker()

generateServiceWorker() will generate the service worker code based on your build. Unlike other parts of polymer-build, generateServiceWorker() returns a promise and not a stream. It can only be run after your build has finished writing to disk, so that it is able to analyze the entire build as it exists.

For bundled builds, be sure to set the bundled option to true. See AddServiceWorkerOptions for a list of all supported options.

const generateServiceWorker = require('polymer-build').generateServiceWorker;

generateServiceWorker({
  buildRoot: 'build/',
  project: project,
  bundled: true, // set if `project.bundler()` was used
  swPrecacheConfig: {
    // See https://github.com/GoogleChrome/sw-precache#options-parameter for all supported options
    navigateFallback: '/index.html',
  }
}).then(() => { // ...

generateServiceWorker() is built on top of the sw-precache library. Any options it supports can be passed directly to that library via the swPrecacheConfig option. See sw-preache for a list of all supported options

In some cases you may need to whitelist 3rd party services with sw-precache, so the Service Worker doesn't intercept them. For instance, if you're hosting your app on Firebase, you'll want to add the navigateFallbackWhitelist: [/^(?!\/__)/] option to your swPrecacheConfig as Firebase owns the __ namespace, and intercepting it will cause things like OAuth to fail.

addServiceWorker()

Like generateServiceWorker(), but writes the generated service worker to the file path you specify in the path option ("service-worker.js" by default).

const addServiceWorker = require('polymer-build').addServiceWorker;

addServiceWorker({
  buildRoot: 'build/',
  project: project,
}).then(() => { // ...

Generating an HTTP/2 Push Manifest

polymer-build can automatically generate a push manifest for your application. This JSON file can be read by any HTTP/2 push-enabled web server to more easily construct the appropriate Link: <URL>; rel=preload; as=<TYPE> headers(s) for HTTP/2 push/preload. Check out http2push-gae for an example Google Apps Engine server that supports this.

The generated push manifest describes the following behavior: Requesting the shell should push any shell dependencies as well. Requesting a fragment should push any dependencies of that fragment that were not already pushed by the shell. If no shell was defined for your build, polymer-build will use the application entrypoint URL instead (default: index.html).

project.addPushManifest()

This method will return a transform stream that injects a new push manifest into your build (default: push-manifest.json). The push manifest is based off the application import graph, so make sure that this stream is added after all changes to the application source code.

Use the filePath argument to configure the name of the generated file (relative to your application root).

Use the prefix argument to prepend a string to all resource paths in the generated manifest. This can be useful when a build is going to be served from a sub-directory on the server.

const gulp = require('gulp');
const mergeStream = require('merge-stream');

mergeStream(project.sources(), project.dependencies())
  .pipe(project.addPushManifest())
  .pipe(gulp.dest('build/'));

Custom Elements ES5 Adapter

If your build pipeline outputs ES5 custom elements (either from source or by compilation with a tool like Babel), it is critical to include the Custom Elements ES5 Adapter. This adapter provides compatibility between custom elements defined as ES5-style classes and browsers with native implementations of the Custom Elements API, such as Chrome. See the adapter documentation for details of why this is necessary.

project.addCustomElementsEs5Adapter()

This method will return a transform stream that identifies your entrypoint HTML file (by looking for a webcomponents polyfill import) and injects a block of HTML that loads the Custom Elements ES5 Adapter. You can use this in a build pipeline to conditionally inject the adapter only when you output ES5 (as it is not needed when you output ES6).

const gulp = require('gulp');
const mergeStream = require('merge-stream');

mergeStream(project.sources(), project.dependencies())
  .pipe(project.addCustomElementsEs5Adapter())
  .pipe(gulp.dest('build/'));

Multiple Builds

forkStream(stream)

Sometimes you'll want to pipe a build to multiple destinations. forkStream() creates a new stream that copies the original stream, cloning all files that pass through it.

const gulp = require('gulp');
const mergeStream = require('merge-stream');
const forkStream = require('polymer-build').forkStream;

// Create a combined build stream of your application files
const buildStream = mergeStream(project.sources(), project.dependencies());

// Fork your build stream to write directly to the 'build/unbundled' dir
const unbundledBuildStream = forkStream(buildStream)
  .pipe(gulp.dest('build/unbundled'));

// Fork your build stream to bundle your application and write to the 'build/bundled' dir
const bundledBuildStream = forkStream(buildStream)
  .pipe(project.bundler())
  .pipe(gulp.dest('build/bundled'));

project.updateBaseTag()

This method will return a transform stream that finds a <base> tag in your configured entrypoint HTML file, and updates it with the specified value. This can be useful when multiple builds are served each from their own sub-directory on the same host, in conjunction with a convention of using relative URLs for static resources. Your entrypoint must already contain a <base href="/"> or similar tag in its <head>, before any imports.

Note that only the entrypoint will be updated. Fragments with <base> tags will not be modified. Fragments should typically use relative URLs to refer to other artifacts in the build, so that they are agnostic to their serving path. The entrypoint gets special treatment here because it is typically served from paths that do not correspond to its location relative to other build artifacts.

const gulp = require('gulp');
const mergeStream = require('merge-stream');
const forkStream = require('polymer-build').forkStream;

const buildStream = mergeStream(project.sources(), project.dependencies());

const unbundledBuildStream = forkStream(buildStream)
  // This build will be served from http://example.com/unbundled/
  .pipe(project.updateBaseTag('/unbundled/'))
  .pipe(gulp.dest('build/unbundled'));

const bundledBuildStream = forkStream(buildStream)
  .pipe(project.bundler())
  // While this build will be served from http://example.com/bundled/
  .pipe(project.updateBaseTag('/bundled/'))
  .pipe(gulp.dest('build/bundled'));

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

You can compile polymer-build from source by cloning the repo and then running npm run build. Make sure you have already run npm install before compiling.

Supported Node.js Versions

polymer-build officially supports the latest current & active LTS versions of Node.js. See our .travis.yml for the current versions of Node.js under test and visit the Polymer Tools Node.js Support Policy for more information.

changelog

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[3.1.4] - 2019-04-26

  • Fixed an issue where bare specifiers were not rewritten for dynamic imports after transforming them to AMD require statements.

[3.1.3] - 2019-04-02

  • Disabled babel-plugin-minify-builtins and babel-plugin-minify-remove-undefined due to errors in babel-preset-minify.

[3.1.2] - 2019-03-01

  • Added support for treeshake option to remove dead JavaScript code when bundling.

[3.1.1] - 2018-11-12

  • Fix issue with deadcode removal in babel-minify, by turning it off, as it can be error prone and result in removal of code which should not be removed and cause hard to debug errors. https://github.com/Polymer/tools/issues/724

[3.1.0] - 2018-10-15

  • Added wct-mocha to the set of recognized WCT client-side packages in htmlTransform when using @polymer/esm-amd-loader.

[3.0.4] - 2018-06-28

  • Fix NPM audit warnings.

[3.0.3] - 2018-06-25

  • Service Worker generation uses a consistent spacing for anonymous functions (i.e. space between keyword and parentheses function ()) ensuring Node 8 and 10 output are identical.

[3.0.2] - 2018-06-19

  • Fix incorrect relative paths to the component directory in push manifests.
  • Fix push manifest generation crash with ES module projects.

[3.0.1] - 2018-05-14

  • Pin dependency babel-plugin-minify-guarded-expressions of babel-preset-minify to known working version 0.4.1.

[3.0.0] - 2018-05-08

  • Updated dependencies.

[3.0.0-pre.17] - 2018-05-03

  • The transform for import.meta now uses the special "meta" dependency provided by @polymer/esm-amd-loader, instead of injecting a static path. As a result, it is now always coupled with the AMD transform, and cannot be enabled independently.
  • The regenerator runtime can now be injected either inline each time it is used by jsTransform, or inline into the HTML document by htmlTransform.
  • Added es5, es2015, es2016, es2017, and es2018 compile targets to jsTransform to allow fine grained control over what features to compile.

[3.0.0-pre.16] - 2018-05-01

[3.0.0-pre.15] - 2018-04-25

  • @babel/preset-es2015 has been replaced with a manually-created version so that @babel/plugin-transform-classes can be pinned to v7.0.0-beta.35 to avoid a bug where the polyfilled HTMLElement constructor is not called. (https://github.com/babel/babel/issues/7506)

[3.0.0-pre.14] - 2018-04-23

[3.0.0-pre.13] - 2018-04-18

  • Fix node module resolution for the case where the root package is served from the components/ directory and imports a module from its own package using a path.

[3.0.0-pre.12] - 2018-04-17

  • The Babel helpers script now includes all Babel helpers that could be used by the ES5 compilation and AMD transforms.
  • The jsTransform function's injectBabelHelpers option now has 3 possible values: none (default), full, and amd.
  • Inline JavaScript will now only be transformed to AMD modules if they have type=module.
  • External JavaScript files will now only be transformed to AMD modules if they contain module import/export syntax.

[3.0.0-pre.11] - 2018-04-11

  • Fix AMD transform bug where if an HTML document had multiple type=module scripts, and any of them (apart from the first) had any kind of import, then that import was not accessible (because it was mapped to the wrong module callback function argument).

[3.0.0-pre.10] - 2018-04-09

  • [breaking] The jsTransform function will now inline any required Babel helper functions by default. Previously they were always omitted. Added externalHelpers option to disable inlining. Note that the behavior of the build transformers from getOptimizeStreams continue to never inline the Babel helpers.

[3.0.0-pre.9] - 2018-04-05

  • Fix bug with node module resolution where specifiers in dynamic import() were rewritten.
  • Fix bug with dynamic import rewriting where imported require function could not be called.

[3.0.0-pre.8] - 2018-04-04

  • Fix bug where not all percent-encoded characters in URIs would be decoded (in particular, %40 -> @ which is important for scoped NPM packages).

[3.0.0-pre.7] - 2018-04-03

  • [breaking] Rename jsTransform and getOptimizeStreams option from transformEsModuleToAmd to transformModuleToAmd.
  • [breaking] The transformModulesToAmd option in jsTransform now automatically implies transformImportMeta, and throws if transformImportMeta is set to false.
  • [breaking] The JsTransform class now takes a full OptimizeOptions instead of just a JsOptimizeOptions.

[3.0.0-pre.6] - 2018-04-02

  • Add an import.meta transform to jsTransform with the transformImportMeta option.
  • Add a dynamic import() transform to AMD require()

[3.0.0-pre.5] - 2018-03-28

  • AMD loader will now only be injected into an HTML document if it contains at least one type=module script.
  • Added softSyntaxError option to jsTransform. If set, Babel parse errors will no longer throw. Instead, a console error will be logged, and the original JS returned.
  • Expose htmlTransform from main package index.

[3.0.0-pre.4] - 2018-03-28

  • ES to AMD module transformation is now supported by getOptimizeStreams and htmlTransform. Additionally:
    • Will now inject an inline minified RequireJS AMD loader, and the Babel helpers.
    • Phantom <html>, <head>, and <body> tags injected by parse5 are now removed.

[3.0.0-pre.3] - 2018-03-28

[3.0.0-pre.2] - 2018-03-26

  • Add htmlTransform function, factored out of the Polyserve compile-middleware module.
  • Add ordered execution to the ES to AMD module transformation in htmlTransform.
  • Node module specifier rewriter will now resolve paths according to the node module resolution algorithm, not just bare specifiers (e.g. "./foo" resolves to "./foo.js").

[3.0.0-pre.1] - 2018-03-21

[2.5.0] - 2018-03-21

  • Add packageName option to jsTransform() function. Option is required when isComponentRequest option is true.

[2.4.1] - 2018-03-20

  • Fix import specifier rewriting when importing a dependency from a top-level module.

[2.4.0] - 2018-03-19

  • Fix dependency specification for babel-core
  • Add jsTransform function, factored out of optimize-streams module (so that it can be shared with Polyserve).
  • Renamed jsTransform option from compile to compileToEs5 to clarify its behavior.
  • Added transformEsModulesToAmd option to jsTransform and JS stream transformer.
  • Add exponentiation, async/await, and async generator syntax/transform support to jsTransform.

[2.3.3] - 2018-03-14

  • Don't run Babel at all if there are no meaningful changes to make.

[2.3.2] - 2018-03-13

  • Fix bug where JS compilation/minification would ignore the "excludes" field.

[2.3.1] - 2018-03-12

[2.3.0] - 2018-03-12

  • JS compile and other "optimize streams" build transformers have been moved from polyer-cli into this package.
  • JS compile build transformer wil now rewrite bare module specifiers to paths.
  • Module bare specifier rewriting Babel plugin has been moved from polyserve into this package.
  • Module bare specifier rewriting Babel plugin now works on Windows, does not rewrite fully qualified URLs, and will follow the "module" or "jsnext:main" fields when a package.json uses them instead of "main".

[2.2.0] - 2018-02-23

  • Fixed issue where the build silently fails when several source dependencies are missing
  • If the ProjectConfig given to BuildAnalyzer has a componentDir, pass a PackageUrlResolver using that componentDir to the underlying Analyzer.
  • Warnings indicated in the lint.warningsToIgnore ProjectConfig option are now ignored.

[2.1.1] - 2017-10-23

  • Updated polymer-bundler to 3.1.1, to fix an issue with deprecated CSS imports being inlined into the wrong templates.

[2.1.0] - 2017-10-02

  • Updated polymer-bundler to 3.1.0, which inlines external stylesheet links in templates.

[2.0.0] - 2017-07-18

  • [Breaking] Upgraded polymer-bundler to 3.x, which includes new default behavior around the rewriteUrlsInTemplates option in support of Polymer 2.x defaults. Polymer 1.x project developers should set the option rewriteUrlsInTemplates: true. See using polymer-bundler programmatically for more information.

[1.6.0] - 2017-06-29

  • Automatically recognize any lazy-imports encountered as fragments when generating push-manifest.
  • The addPushManifest feature now honors the laziness of html-imports and excludes them from the set of their importers' pushed assets.
  • Upgraded Polymer Bundler to 2.2.0, which updated the shell strategy so that the shell is no longer linked to from other bundles. See Bundler issue #471 for more details.

[1.5.1] - 2017-06-02

  • Prefetch links are now only added for transitive dependencies.

[1.5.0] - 2017-05-23

  • Service Worker generator now generates relative URLs for pre-cached assets instead of absolute. This makes it possible to cache assets when the app is served from a non-root path without re-mapping all URLs. Since server workers fetch relative to their own URL, there is no effective change for service workers served from the root path.
  • Service Worker generator now better caches the entrypoint by setting navigateFallback and related options.

[1.4.2] - 2017-05-19

  • Updated the AddPrefetchLinks transform to not insert html root element tags like <html>, <head> or <body>.

[1.4.1] - 2017-05-18

  • Updated dependency on polymer-bundler to use official 2.0.0 release and enable unmediated semver upgrades.
  • Fixed issue with push manifest URLs being a mix of relative and absolute URLs (now always relative), and a double-delimiter issue when using basePath.

[1.4.0] - 2017-05-18

  • Added PolymerProject.addPrefetchLinks() transform.
  • Added PolymerProject.addBabelHelpersInEntrypoint() transform.

[1.3.1] - 2017-05-16

  • Updated polymer-project-config dependency.

[1.3.0] - 2017-05-15

  • A prefix can now be passed to addPushManifest(), which will be prepended to all push manifest resource paths.
  • A basePath can now be passed to the service worker generator, where it will be used as the sw-precache replacePrefix.
  • Upgrade to Polymer Analyzer that changes many errors to warnings for more robust builds.

[1.2.5] - 2017-05-15

  • Updated polymer-analyzer dependency to ^2.0.0 now that it is out of alpha.

[1.2.4] - 2017-05-11

  • Simplify addCustomElementsEs5Adapter() adapter injection method.
  • Bundler stream no longer emits any CSS or Javascript files which have been inlined into bundles.

[1.2.3] - 2017-05-10

  • Dependency updates. Fixes issue with polymer-bundler's handling of lazy-import links in dom-modules.

[1.2.2] - 2017-05-09

  • Dependency updates. Update to sw-precache@5 to prevent "corrupted data" errors on Firefox 52 and Chrome 59 when using addServiceWorker(). Upgraded polymer-bundler and polymer-analyzer to address lazy-import bugs.

[1.2.1] - 2017-05-03

  • Dependency updates. Upgraded to new polymer-bundler. Most important update is a fix to bug whereby lazy-import links were being moved out of their <dom-module> containers.

[1.2.0] - 2017-05-02

  • Dependency updates. Upgraded to new polymer-bundler, polymer-analyzer and dom5 versions.
  • Fixed bug where <html>, <head> and <body> were added to documents mutated by HtmlSplitter and the CustomElementsES5AdapterInjector.
  • Print build-time warnings and errors with full location information, and precise underlines of the place where the problem was identified.
  • Fixed issue where two copies of entrypoint files with same name are emitted by bundler stream: an un-bundled one, followed by bundled one.
  • Fixed issue where html imports were emitted by bundler as individual files even though they were bundled.
  • Added an options argument to PolymerProject#bundler() to support users configuring the bundler. Options include all Bundler#constructor options, analyzer, excludes, inlineCss, inlineScripts, rewriteUrlsInTemplates, sourcemaps, stripComments, as well as strategy and urlMapper which are used on call to Bundler#generateManifest.

[1.1.0] - 2017-04-14

  • Add addCustomElementsEs5Adapter() method to PolymerProject. Provides an adapter needed when serving ES5 to browsers that support the native Custom Elements API.

[1.0.0] - 2017-04-11

  • [Breaking] Remove Node v4 support: Node v4 is no longer in Active LTS, so as per the Polymer Tools Node.js Support Policy polymer-build will not support Node v4. Please update to Node v6 or later to continue using the latest verisons of Polymer tooling.
  • New Feature: add automatic HTTP/2 push manifest generation for HTTP/2 Push-enabled servers.

[0.9.1] - 2017-03-20

  • Fixed issue with Service Worker generation in Windows environment where full paths were put into its precacheConfig instead of relative paths.
  • Bundled files always use canonical platform separators in their paths now. Previously, files might have either back-slashes or forward-slashes on Windows, depending on how they arrived at the Bundler and this caused the Analyzer to treat files as missing when mapping them by path.

[0.9.0] - 2017-03-15

  • [breaking] PolymerProject's bundler property is now a bundler() method, returning a new BuildBundler stream on each call. This is to support parallel pipelines using bundler.

[0.8.4] - 2017-03-04

  • Build now delegates authority to the Analyzer for what urls are package external instead of local heuristics.
  • Bundling now processes files coming in from streams, to support things like js-minification before bundling.

[0.8.3] - 2017-03-03

  • Dependency updates.

[0.8.2] - 2017-02-24

  • Dependency updates

[0.8.1] - 2017-02-17

  • Update the version of polymer-bundler to fix several bugs:
    • Fix regressions in url attribute updating (src, href, assetpath).
    • Added support for <base> href and target attribute emulation on bundled output.
    • Whitespace-agnostic license comment deduplication.
    • Server-side includes no longer stripped as comments.

[0.8.0] - 2017-02-14

  • project.splitHtml() & project.rejoinHtml() methods have been pulled off of PolymerProject so that multiple streams can split/rejoin in parallel. See the new README section on HTMLSplitter for updated instructions on how to split/rejoin inline scripts and styles in your build stream.
  • Completed the migration away from hydrolysis to polymer-analyzer and vulcanize to polymer-bundler.
  • Do a better job of only listing warnings for code in the package being built.

[0.7.1] - 2017-02-03

  • Fix issue where larger projects would cause the sources stream to hang.

[0.7.0] - 2017-01-31

  • BuildAnalyzer.sources & BuildAnalyzer.dependencies are now BuildAnalyzer.sources() & BuildAnalyzer.dependencies(), respectively. This change only affects uses who are importing and/or using the BuildAnalyzer class directly.
  • Fix issue where files were being loaded immediately, before the build stream was started.

[0.6.0] - 2017-01-04

  • Fix issue where missing source files were causing silent stream failures.
  • Interface Update! PolymerProject.analyzer is no longer a required step in your build pipeline. Instead, analysis happens automatically while it fills the project.sources() and project.dependencies() streams with your project files. See the README for updated examples of what build streams look like without the analyzer.
  • merge-stream users: Update to v1.0.1 or later if you are using merge-stream with polymer-build. Stream errors do not propagate properly in previous versions of the library, and your build task may silently fail as a result.
  • StreamAnalyzer is now BuildAnalyzer (since it is no longer a stream). This change only affects uses who are importing and/or using StreamAnalyzer directly from the polymer-build module.
  • Fix issue where behaviors were not being analyzed properly.
  • Update the version of polymer-analyzer we use, fixing a number of errors.
<summary>v0.6.0 Pre-Release Changelog</summary>

[0.6.0-alpha.3] - 2016-12-19

  • Actually update the version of polymer-analyzer we use, fixing a number of errors. (alpha.2 was accidentally a noop release).

[0.6.0-alpha.2] - 2016-12-19

  • Update the version of polymer-analyzer we use, fixing a number of errors.

[0.6.0-alpha.1] - 2016-12-13

  • Interface Update! PolymerProject.analyzer is no longer a required step in your build pipeline. Instead, analysis happens automatically while it fills the project.sources() and project.dependencies() streams with your project files. See the README for updated examples of what build streams look like without the analyzer.
  • merge-stream users: Update to v1.0.1 or later if you are using merge-stream with polymer-build. Stream errors do not propagate properly in previous versions of the library, and your build task may silently fail as a result.
  • StreamAnalyzer is now BuildAnalyzer (since it is no longer a stream). This change only affects uses who are importing and/or using StreamAnalyzer directly from the polymer-build module.
  • Fix issue where behaviors were not being analyzed properly.

[0.5.1] - 2016-12-02

  • Updated polymer-analyzer to 2.0.0-alpha.18

[0.5.0] - 2016-11-01

  • New Analyzer! Should fix most reported bugs that were caused by bad analysis, but may introduce new ones. Be sure to test your build after upgrading to confirm that your build is still functioning. See polymer-analyzer for more information.
    • Fixed silent failures during build analysis.
    • Added warning printing during build analysis (#54).
  • Added support for relative root paths.
  • Renamed two AddServiceWorkerOptions properties:
    • serviceWorkerPath was renamed to path.
    • swConfig was renamed to swPrecacheConfig.
    • Old names are deprecated, and support for them will be removed in future versions.
  • polymer.json configuration now managed by polymer-project-config
  • Upgrade outdated dependencies:
    • `sw-precache@4.2.0` generates a new kind of service-worker that will require all users to repopulate their cache. Otherwise it continues to behave the same as before.

[0.4.1] - 2016-08-24

Fixed

[0.4.0] - 2016-08-05

Fixed

Added

  • Generate .d.ts files for typescript users.