1.1.0 • Published 5 years ago

webpack-fabricator-assemble v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Webpack Fabricator Assemble

A webpack plugin for the fabricator-assemble module.

How to install

npm i --save-dev webpack-fabricator-assemble

Examples

Without using the HtmlWebpackPlugin

const path = require('path');
const WebpackFabricatorAssemble = require('webpack-fabricator-assemble');

module.exports = {
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js'
  },
  plugins: [
    new WebpackFabricatorAssemble()
  ]
};

With using the HtmlWebpackPlugin

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const WebpackFabricatorAssemble = require('webpack-fabricator-assemble')(HtmlWebpackPlugin);

module.exports = {
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js'
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: path.resolve(__dirname, 'src/views/layouts/default.html'),
      filename: path.resolve(__dirname, 'dist/default.html'),
      inject: false
    }),
    new WebpackFabricatorAssemble({
      layouts: [path.resolve(__dirname, 'dist/default.html')],
    }),
  ]
};

License

MIT © ksotello