2.2.92 • Published 6 years ago

yamasters-backendtree-webpack-plugin-new v2.2.92

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

HTML Webpack Plugin

NPM

This is a webpack plugin that simplifies creation of development files for Yamasters backend team. This plugin creates *.php files with auto includes.

Maintainer: vtlk @vtlk7

Installation

Install the plugin with npm:

$ npm install yamasters-backendtree-webpack-plugin --save-dev

Important

This plugin works only in pair with html-component-loader.

Basic Usage

The plugin will generate an HTML5 file for you that includes all your webpack bundles in the body using script tags. Just add the plugin to your webpack config as follows:

var YamastersBackendtree = require('yamasters-backendtree-webpack-plugin');
var webpackConfig = {
  entry: 'index.js',
  output: {
    path: 'dist',
    filename: 'index_bundle.js'
  },
  plugins: [new YamastersBackendtree({
	  from: path.resolve(__dirname, 'dist'),
	  to: path.resolve(__dirname, 'php')
  })]
};

This will generate a file php/index.php containing the following:

<!DOCTYPE html>
<html>
  <head>
    <? include '/includes/head.php'; ?>
  </head>
  <body>
    <? include '/includes/blocks/someblock.php'; ?>
    <script src="index_bundle.js"></script>
  </body>
</html>

Configuration

Allowed values are as follows:

  • from: Dist directory, that contains generated html files and bundles.
  • to: Directory for .php files. Bundles will be copied from dist.

License

This project is licensed under MIT.

2.2.92

6 years ago

2.2.91

6 years ago

2.2.9

6 years ago

2.2.8

6 years ago

2.2.7

6 years ago

2.2.6

6 years ago

2.2.5

6 years ago