1.0.9 • Published 4 years ago

pug-extract-loader v1.0.9

Weekly downloads
53
License
GPL-3.0
Repository
github
Last release
4 years ago

pug-extract-loader

npm version

Webpack loader to extract pug to HTML, calling all dependencies found in the code

This loader is projected to be appended to pug-loader
File-loader can be appended to this loader

Usage

    {
        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

1.0.9

4 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago