tile-extrude-webpack-plugin

1.2.0 • Public • Published

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:

Key What is
size Tile size.
input Input directory. Original images should be here.
output Output directory. Extruded images will be here.
minify Minify 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

Readme

Keywords

none

Package Sidebar

Install

npm i tile-extrude-webpack-plugin

Weekly Downloads

2

Version

1.2.0

License

MIT

Unpacked Size

6.61 kB

Total Files

6

Last publish

Collaborators

  • laineus