@@ -37,7 +37,7 @@ if (!options.input) {
37
37
38
38
var DEFAULT_OUTPUT = 'vulcanized.html' ;
39
39
if ( ! options . output ) {
40
- console . warn ( 'Default output to index- vulcanized.html' + ( options . csp ? ', vulcanized.js, ' : '' ) + ' and vulcanized.html in the input directory.' ) ;
40
+ console . warn ( 'Default output to vulcanized.html' + ( options . csp ? ' and vulcanized.js' : '' ) + ' in the input directory.' ) ;
41
41
options . output = path . resolve ( path . dirname ( options . input ) , DEFAULT_OUTPUT ) ;
42
42
}
43
43
@@ -173,6 +173,15 @@ function insertImport($, storedPosition, importText) {
173
173
pos [ operation ] ( importText ) ;
174
174
}
175
175
176
+ function insertInlinedImports ( $ , importText ) {
177
+ var pos = $ ( 'body' ) . last ( ) ;
178
+ var operation = 'prepend' ;
179
+ if ( ! pos . length ) {
180
+ pos = $ . root ( ) ;
181
+ }
182
+ pos [ operation ] ( importText ) ;
183
+ }
184
+
176
185
function handleMainDocument ( ) {
177
186
var $ = readDocument ( options . input ) ;
178
187
var dir = path . dirname ( options . input ) ;
@@ -213,10 +222,9 @@ function handleMainDocument() {
213
222
findScriptLocation ( $ ) . append ( EOL + scripts_after_polymer . join ( EOL ) + EOL ) ;
214
223
}
215
224
216
- fs . writeFileSync ( options . output , output , 'utf8' ) ;
217
- imports_before_polymer . push ( '<link rel="import" href="' + path . basename ( options . output ) + '">' ) ;
218
225
insertImport ( $ , import_pos , imports_before_polymer . join ( EOL ) + EOL ) ;
219
- fs . writeFileSync ( path . resolve ( outputDir , 'index-vulcanized.html' ) , $ . html ( ) , 'utf8' ) ;
226
+ insertInlinedImports ( $ , output ) ;
227
+ fs . writeFileSync ( options . output , $ . html ( ) , 'utf8' ) ;
220
228
}
221
229
222
230
handleMainDocument ( ) ;
0 commit comments