M
M
Mopper2015-12-23 00:39:18
JavaScript
Mopper, 2015-12-23 00:39:18

How to collect all the included resources of an HTML page into one file?

It is necessary to compress into one page, the page itself and the included javascript and style sheets:

<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootswatch/3.0.0/journal/bootstrap.min.css">
  <link rel="stylesheet" type="text/css" media="screen"  href="http://www.guriddo.net/demo/css/trirand/ui.jqgrid-bootstrap.css">
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
  <script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="http://www.guriddo.net/demo/js/trirand/jquery.jqGrid.min.js"></script>
  <script type="text/javascript" src="http://www.guriddo.net/demo/js/trirand/i18n/grid.locale-en.js"></script>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

How can I do that? Is there a utility or site like jsbeautifier just for packaging?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Stanislav Kirichenko, 2015-12-23
@Staurus

Isn't it easier to upload everything to a computer, put it in one css and one js and upload two files to the server?

P
Pshkll, 2015-12-23
@Pshkll

Refresh-SF

A
Andrey, 2015-12-23
@svistiboshka

Catch https://github.com/fmal/gulp-inline-source

A
Alexander N++, 2015-12-23
@sanchezzzhak

refresh-sf.com
yui.github.io/yuicompressor

M
Mopper, 2015-12-28
@Mopper

Briefly if anyone is interested. None of your services worked. One file is too large, the other has a syntax error. yuicompressor mastered, but jquery was inoperable.
I have used this

// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// @output_file_name default.js
// @code_url https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js
// @code_url https://netdna.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js
// @code_url http://www.guriddo.net/demo/js/trirand/jquery.jqGrid.min.js
// @code_url http://www.guriddo.net/demo/js/trirand/i18n/grid.locale-en.js
// @code_url http://code.jquery.com/ui/1.11.4/jquery-ui.js
// ==/ClosureCompiler==

link
result inserted between two tags

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question