Vulcanize v1 factored out --csp. How-to now?

105 views
Skip to first unread message

Silver Techar

unread,
Apr 13, 2015, 10:32:50 AM4/13/15
to polym...@googlegroups.com
Hi,

How do you do following v.0.7 vulcanize command in the braeking v.1 ?

My vulacnize v.0.7 command was: vulcanize -o ../build.html ../index.html --strip --csp

where index.html looked something like

<!doctype html>
<html>
<head>
     <script src="all.js"></script>

    <link rel="import" href="bower_components/paper-input/paper-input.html">
..etc..
</head>
<body>
<x-app></x-app>
</body>
</html>


Ref: https://github.com/Polymer/vulcanize/blob/master/CHANGELOG.md

Kr,
Ainur

Eric Bidelman

unread,
Apr 13, 2015, 11:38:19 AM4/13/15
to Silver Techar, polym...@googlegroups.com, Daniel Freedman
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/75741b5b-51f8-4bbe-8f42-9ed85cbdbfbc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Freedman

unread,
Apr 13, 2015, 2:30:34 PM4/13/15
to Eric Bidelman, Silver Techar, polymer-dev
I factored out the CSP component into a new project called crisper: https://github.com/polymerlabs/crisper.

You can pipe the output of vulcanize through crisper to make separate JS and HTML files:

vulcanize target.html | crisper --html build.html --js build.js

I'll put this into the README of vulcanize.
Message has been deleted
Message has been deleted
Message has been deleted

Silver Techar

unread,
Apr 14, 2015, 2:31:03 AM4/14/15
to polym...@googlegroups.com, ebi...@gmail.com, silver...@gmail.com
Hi and thanks,
breaking change was glued now :)

Here is some quick feedback:


1.) I expected help when executing command without arguments

C:\>crisper

path.js:116
        throw new TypeError('Arguments to path.resolve must be strings');
              ^
TypeError: Arguments to path.resolve must be strings
    at Object.exports.resolve (path.js:116:15)
    at Object.exports.relative (path.js:240:18)
    at Object.<anonymous> (C:\Users\x\AppData\Roaming\npm\node_modules\crisper\bin\crisper:35:25)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3
  
2.) You could say that crisper command should be
crisper --source vulcanized.html --html build.html --js build.js
since vulcanized.html is vulcanize's default output file name

instead of
crisper --source index.html --html build.html --js build.js
which produces 0byte build.js and a copy of index.html and appended <x-app></x-app><script src="build.js"></script></body></html> at the end inside of build.html (as observed)

3.) Piping does not work
    vulcanize index.html | crisper --html build.html --js build.js
  
    produces 0byte build.js and following line in build.html
    <html><head></head><body><script src="build.js"></script></body></html>



What worked (from my point of view / as I expect)

vulcanize index.html
crisper --source vulcanized.html --html build.html --js build.js  


Thx for polymer and vulcanize!

Kr,
Ainur
Reply all
Reply to author
Forward
0 new messages