Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Break out constants
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Feb 25, 2014
1 parent 08101f9 commit 83dfa1a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
21 changes: 21 additions & 0 deletions lib/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2013 The Polymer Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/

var JS = 'script:not([type]), script[type="text/javascript"]';
var URL_ATTR = ['href', 'src', 'action', 'style'];

module.exports = {
EOL: require('os').EOL,
ABS_URL: /(^data:)|(^http[s]?:)|(^\/)/,
IMPORTS: 'link[rel="import"][href]',
URL: /url\([^)]*\)/g,
URL_ATTR: URL_ATTR,
URL_ATTR_SEL: '[' + URL_ATTR.join('],[') + ']',
URL_TEMPLATE: '{{.*}}',
JS: JS,
JS_SRC: JS.split(',').map(function(s){ return s + '[src]'; }).join(','),
CSS: 'style:not([type]), style[type="text/css"]',
};
22 changes: 4 additions & 18 deletions lib/vulcan.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,15 @@
* license that can be found in the LICENSE file.
*/

var fs = require('fs');
var path = require('path');
var url = require('url');
var async = require('async');
var cheerio = require('cheerio');
var cleancss = require('clean-css');
var fs = require('fs');
var path = require('path');
var uglify = require('uglify-js');

var EOL = require('os').EOL;
var ABS_URL = /(^data:)|(^http[s]?:)|(^\/)/;
var DEFAULT_OUTPUT = 'vulcanized.html';
var ELEMENTS = 'polymer-element';
var IMPORTS = 'link[rel="import"][href]';
var POLYFILLS = 'script[src $= "platform.js"]';
var URL = /url\([^)]*\)/g;
var URL_ATTR = ['href', 'src', 'action', 'style'];
var URL_ATTR_SEL = '[' + URL_ATTR.join('],[') + ']';
var URL_TEMPLATE = '{{.*}}';

var JS = 'script:not([type]), script[type="text/javascript"]';
var JS_SRC = JS.split(',').map(function(s){ return s + '[src]'; }).join(',');
var CSS = 'style:not([type]), style[type="text/css"]';

var excludes = {};
var constants = require('./constants.js');

var import_buffer = [];
var imports_before_polymer = [];
Expand Down

0 comments on commit 83dfa1a

Please sign in to comment.