node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »


Webpack configuration template

This is an internal Lucify tool that provides a webpack configuration template for Lucify projects.


npm install lucify-webpack-config webpack webpack-dev-server


Create webpack.config.js in your project root:

var lucifyWebpackConfig = require('lucify-webpack-config');
var opts = {
  entry: path.resolve('./src/entry-point.jsx'),
  pageDefs: [{
    title: 'My example page title',
    description: 'Description'
const config = lucifyWebpackConfig.template(opts);
// at this point, you can naturally edit any options 
// options in the returned webpack configuration 
config.output.dist = 'build' // default would be 'dist' 
module.exports = config;

Add the following to your package.json:

  "build": "webpack",
  "start": "webpack-dev-server --inline --hot --port 3000 --host",    

You can then build a distribution in the build folder with:

npm run-script build

Or run a development server:

npm start

Note that there is no need to install any other dependencies, such as webpack loaders.


  • entry: Entry point for javascript bundle. Required.
  • optimize: Set to true to enable optimization of assets. Defaults to false.
  • externalStyles: Set to true to use ExtractTextPlugin to bundle styles in their own file. Defauls to false.
  • pageDefs: Array of objects defining html pages to create. Each object corresponds to a single page, with all its fields being passed to the page template. For each object, the following special fields are available:
    • path: Path of the page, relative to output.publicPath, defaults to ''
    • pageTemplate: Handlebars page template for the page. Defaults to src/page-template.hbs.
    • filename Filename for the page, without path. Defaults to index.html.


Make sure you have the correct node version

nvm use

Then run tests with

npm test


This project is released under the MIT license.