Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thecsea/pug-extract-loader
webpack loader to extract pug to HTML, calling all dependencies found in the code
https://github.com/thecsea/pug-extract-loader
dependencies extract html loader pug webpack
Last synced: 5 days ago
JSON representation
webpack loader to extract pug to HTML, calling all dependencies found in the code
- Host: GitHub
- URL: https://github.com/thecsea/pug-extract-loader
- Owner: thecsea
- License: gpl-3.0
- Created: 2017-10-25T12:38:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-12T00:19:45.000Z (almost 5 years ago)
- Last Synced: 2024-04-25T14:42:45.579Z (9 months ago)
- Topics: dependencies, extract, html, loader, pug, webpack
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pug-extract-loader
[![npm version](https://badge.fury.io/js/pug-extract-loader.svg)](https://badge.fury.io/js/pug-extract-loader)Webpack loader to extract pug to HTML, calling all dependencies found in the code
This loader is projected to be appended to [pug-loader](https://github.com/pugjs/pug-loader)
[File-loader](https://github.com/webpack-contrib/file-loader) can be appended to this loader## Usage
``` javascript
{
test: /\.pug$/,
include: [path.resolve(__dirname,'src', 'views', 'pages')],
loaders: [
{loader: 'file-loader', options: {context: path.resolve(__dirname, 'src', 'views', 'pages'), name: '[path][name].html'}}
{loader: 'pug-extract-loader', options: {locals: {testVar: 'test'}}}},
{loader: 'pug-loader', options: {pretty: true, doctype: 'html'}},
]
},
{
test: /\.pug$/,
include: [path.resolve(__dirname,'src', 'views', 'includes')],
loaders: [
{loader: 'pug-loader', options: {pretty: true, doctype: 'html'}},
]
}
```
includes are parsed by main page, so the script should not be appended