![Add a script into pug template](https://knopkazmeya.com/9.png)
You can require('pug-pack') yourself, if you really want to. See pug-pack -help for more, or see the CLI here. Write a bare-bones src/index.pug file, as per the quickstart above init/ -i will initialize pug-pack in the current directory:Īdd a "dev" and "build" run-script to package.json list/ -l will list all files involved in the build clean/ -c will remove the output directory first watch/ w will use browser-sync to watch src and re-run your build production/ -p will minify everything as much as possible You can override the src and dist directories, and/or pass other options, Src/bootstrap.css, that is the Bootstrap CSS that will be used. Any file naming collisions will override theįiles from pug-pack in favor of your version, so if you have Pug-pack will compile the assets in its own src directory first, and thenĬompile your own src files.
![add a script into pug template add a script into pug template](https://grumblepugs.files.wordpress.com/2016/06/jewel-moose-valeria.jpg)
GIT_TAGS: any tags that refer to GIT_HEAD GIT_HEAD: the short git sha of the src HEAD The src object also gets two additional properties: Test/index.pug to see both uses of :inject() with an Tell the filter to produce CSS instead of SVG. Note the css attribute passed to the :inject filter: this is required to creates a "raw" element with a CSS class of "github-svg" : inject ( file= "github.svg" ) // creates a element that declares the "github-svg" CSS class : inject ( file= "github.svg" css ) The :inject(file=".") pug filter will read file relative to your srcĭirectory, NOT relative to the. Injected content can be asyncronously generated, which is not possible with Transform inlined content in the template into plain HTML content Read an asset file and inline it as an HTML element :inject() filter is the main workhorse, and it can either: See non-pug files for more details, or some examples in These assets are included in Pug templates via: Non-pug asset files in the src directory, such as scripts, styles, and
![add a script into pug template add a script into pug template](https://i.pinimg.com/originals/75/4c/e2/754ce289e953927fff1fbeacb526314f.jpg)
pug file is compiled with content generated from all the other Src/foo/bar/baz.pug -> dist/foo/bar/baz.htmlĮach. The dist directory at the exact path they are at, relative to src: src/index.pug -> dist/index.html Inside the src folder create a new index.pug file and then create a simple layout inside it.There are a couple other examples: open dist/hyper.html Npm i -D pug pug-loader html-webpack-pluginĢ.
#Add a script into pug template install
![Add a script into pug template](https://knopkazmeya.com/9.png)