1

So I am trying to create my first web component implementation using this article.

However, I am finding it hard to execute one particular command(I am using windows) which is meant for linux:

"package": "cat dist/elements-demo/{runtime,polyfills,scripts,main}.js | gzip > elements.js.gz",

I tried with multiple article related to web component creation and also using type command but I am getting stuck in build/package generation step, Can someone please help me with the windows equivalent of above command? or any article which could resolve this problem.

Shail_bee
  • 499
  • 4
  • 24
  • have you tried? type file1 file2 > file3 – Soheb Nov 02 '19 at 10:21
  • yes I tried, referenced: https://stackoverflow.com/questions/60244/is-there-replacement-for-cat-on-windows – Shail_bee Nov 02 '19 at 10:25
  • What is the error message that you are getting? – Soheb Nov 02 '19 at 10:35
  • I splitted all the 4 files and able to create 1 output file, now I am creating a zip using gzip command whcich is not recognized. So currently looking into: https://stackoverflow.com/questions/36733176/how-do-i-add-a-gzip-command-to-windows-cmd – Shail_bee Nov 02 '19 at 10:37
  • By the way, the new powershell support most of Unix command. check the link below: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-6#powershell-core – Soheb Nov 02 '19 at 10:40
  • Also check this for gzip in windows command line https://stackoverflow.com/questions/36733176/how-do-i-add-a-gzip-command-to-windows-cmd – Soheb Nov 02 '19 at 10:42
  • @MSoheb, I am trying by installing cygin. However, I am getting some syntax error now while running this command: ```dist/custom-table-renderer/main-es2015.js > elements.js | gzip > elements.js.gz``` – Shail_bee Nov 02 '19 at 10:57

1 Answers1

0

you can do it manually with 7zip https://www.7-zip.org/ 1.) remove

 "package": "cat dist/elements-demo/{runtime,polyfills,scripts,main}.js | gzip elements.js.gz"

2.) build and put dist/elements-demo/{runtime,polyfills,scripts,main}.js in a gzip archive with 7zip and name it elements.js.gz

3.) run http-server --gzip

if you want to do this automatically you can also use the 7zip command line.

maybe a lot easier (i am not sure if this works) you can just remove the --gzip option and run the server http-server without compression.

user
  • 11
  • 6