MCPcopy Create free account
hub / github.com/Festify/app / buildPolymer

Function buildPolymer

scripts/gulp-polymer.js:11–49  ·  view source on GitHub ↗
(project, develop)

Source from the content-addressed store, hash-verified

9const { paths } = require('./gulp-config');
10
11function buildPolymer(project, develop) {
12 const sources = project.sources()
13 .pipe($.if(['index.html', 'app.html'], $.useref()))
14 .pipe($.if('elements/app-shell.html', $.template({
15 ENV: process.env
16 })));
17 const stream = mergeStream(sources, project.dependencies());
18
19 if (develop) {
20 return stream.pipe(project.bundler());
21 }
22
23 const htmlSplitter = new HtmlSplitter();
24 return stream
25 .pipe(htmlSplitter.split())
26 .pipe($.if(/\.html$/, $.htmlPostcss({
27 plugins: [autoprefixer({ browsenrs: ['last 2 versions'] })]
28 })))
29 .pipe($.if(
30 file => path.extname(file.path) === '.js' &&
31 file.path.indexOf('webcomponentsjs') === -1 &&
32 file.path.indexOf('firebase') === -1,
33 $.babel()
34 ))
35 .pipe($.if(
36 file => path.extname(file.path) === '.js' &&
37 file.path.indexOf('webcomponentsjs') === -1 &&
38 file.path.indexOf('firebase') === -1,
39 $.babili()
40 ))
41 .pipe(htmlSplitter.rejoin())
42 .pipe($.if(/\.html$/, $.htmlmin({
43 collapseWhitespace: true,
44 removeComments: true
45 })))
46 .pipe(project.addCustomElementsEs5Adapter())
47 .pipe(project.bundler())
48 .pipe(project.addPushManifest());
49}
50
51gulp.task('polymer', ['prepare-env'], function () {
52 const project = new PolymerProject(require('../polymer.json'));

Callers 1

gulp-polymer.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected