1.2.0 • Published 4 years ago

tile-extrude-webpack-plugin v1.2.0

Weekly downloads
80
License
MIT
Repository
github
Last release
4 years ago

TileExtrudeWebpackPlugin

npm license

A Webpack plugin to extrude tilesets automatically with tile-extruder.

It will be re-extruded automatically when added or modified images while webpack is watching.

Usage

Install:

$ npm install tile-extrude-webpack-plugin

Define into webpack.config.js:

const TileExtrudeWebpackPlugin = require('tile-extrude-webpack-plugin')
// ...
{
  entry: {
    ...
  },
  output: {
    ...
  },
  plugins: [
    new TileExtrudeWebpackPlugin({
      size: 32,
      input: './public/img/original_tilesets',
      output: './public/img/extruded_tilesets'
    })
  ]
}

Options:

KeyWhat is
sizeTile size.
inputInput directory. Original images should be here.
outputOutput directory. Extruded images will be here.
minifyMinify png when extrude. (default is true)

CLI

$ tile-extrude --input <input dir> --output <output dir> --size <tile size> --minify

or

$ tile-extrude --config <path to config>
module.exports = {
  size: 32,
  input: './input',
  output: './output',
  minify: true
}

Requirements

  • Webpack4 or higher

I'm not sure if this will be working on Webpack3 or less. Please make an issue or PR if need it.

Examples Projects that using this plugin