Skip to content

Commit

Permalink
Merge dcfb220 into cd41262
Browse files Browse the repository at this point in the history
  • Loading branch information
andstor committed Apr 27, 2020
2 parents cd41262 + dcfb220 commit e44f233
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org).

## [Unreleased]

### Added
- Bundling with Webpack.

### Changed
- New logo!

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "voxelizer",
"version": "0.1.3",
"description": "Voxelization for 3D models",
"main": "lib/index.js",
"main": "lib/voxelizer.js",
"module": "src/index.js",
"scripts": {
"build": "babel src -d lib",
"test": "jest",
Expand Down
47 changes: 47 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const webpack = require("webpack");
const path = require("path");
const mode = 'production';

const pkg = require('./package.json');
const date = (new Date()).toDateString();

const banner = `${pkg.name} v${pkg.version} ${date}
${pkg.homepage}
@author ${pkg.author.name} <${pkg.author.email}>
@copyright ${date.slice(-4)} ${pkg.author.name}
@license ${pkg.license}
@version ${pkg.version}
@build [hash]`;

let umdConfig = {
mode: mode,
devtool: 'source-map',
entry: "./src/index.js",
output: {
path: path.resolve(__dirname, "lib"),
filename: "voxelizer.js",
library: "Voxelizer",
libraryTarget: 'umd',
globalObject: 'this'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: {
loader: "babel-loader"
}
}
]
},
plugins: [
new webpack.BannerPlugin({banner: banner}),
],
externals: {
three: 'THREE',
}
};

module.exports = umdConfig;

0 comments on commit e44f233

Please sign in to comment.