Skip to content

Instantly share code, notes, and snippets.

@thejmazz
Created March 18, 2017 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thejmazz/477d0a59c630540037e88b541cb11838 to your computer and use it in GitHub Desktop.
Save thejmazz/477d0a59c630540037e88b541cb11838 to your computer and use it in GitHub Desktop.
'use strict'
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const whsAliases = require('whs/tools/alias.js')
const isProd = process.env.NODE_ENV === 'production'
const basePlugins = [
new CopyWebpackPlugin([{
from: 'public',
to: '.'
}], {
ignore: [ '.DS_Store' ]
}),
new HtmlWebpackPlugin({
title: 'Binary Capital',
template: './src/index.html'
}),
new BundleAnalyzerPlugin()
]
const prodPlugins = [
new webpack.LoaderOptionsPlugin({
minimize: true
}),
new webpack.optimize.UglifyJsPlugin()
]
const plugins = isProd ? basePlugins.concat(prodPlugins) : basePlugins
const config = {
entry: './src/app.js',
devtool: isProd ? 'source-map' : 'eval-source-map',
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/'
},
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
exclude: /(node_modules\/(?!whs)|bower_components)/
}, {
test: /\.glsl$/,
loaders: [ 'raw-loader', 'glslify-loader' ],
exclude: /node_modules/
}]
},
resolve: {
alias: whsAliases
},
plugins,
devServer: {
contentBase: path.resolve(__dirname, 'dist'),
stats: { chunks: true }
},
};
module.exports = config
@thejmazz
Copy link
Author

{
  "name": "bincap",
  "version": "0.0.1",
  "description": "",
  "private": true,
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "webpack-dev-server",
    "build": "webpack"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/thejmazz/bincap.git"
  },
  "author": "Julian Mazzitelli <mazzitelli.julian@gmail.com>",
  "bugs": {
    "url": "https://github.com/thejmazz/bincap/issues"
  },
  "homepage": "https://github.com/thejmazz/bincap#readme",
  "devDependencies": {
    "babel-core": "^6.18.2",
    "babel-loader": "^6.2.8",
    "babel-plugin-add-module-exports": "^0.2.1",
    "babel-plugin-glslify": "^2.0.0",
    "babel-plugin-transform-class-properties": "^6.19.0",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-plugin-transform-object-rest-spread": "^6.23.0",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-es2015": "^6.18.0",
    "copy-webpack-plugin": "^4.0.1",
    "gl": "^4.0.3",
    "glslify-loader": "^1.0.2",
    "html-webpack-plugin": "^2.24.1",
    "jimp": "^0.2.27",
    "pngjs": "^3.0.1",
    "raw-loader": "^0.5.1",
    "uglify-js": "^2.8.12",
    "uglifyjs-webpack-plugin": "^0.3.0",
    "webpack": "^2.2.1",
    "webpack-bundle-analyzer": "^2.3.1",
    "webpack-dev-server": "^2.4.1"
  },
  "dependencies": {
    "geo-3d-box": "^2.0.2",
    "gl-mat4": "^1.1.4",
    "gl-vec3": "^1.0.3",
    "glsl-hsl2rgb": "^1.1.0",
    "glsl-noise": "^0.0.0",
    "glsl-random": "^0.0.5",
    "glslify": "^6.0.1",
    "lerp": "^1.0.3",
    "load-bmfont": "^1.3.0",
    "perlin-simplex": "^0.0.2",
    "primitive-plane": "^1.1.0",
    "regl": "^1.3.0",
    "scrollmagic": "^2.0.5",
    "stats.js": "^0.17.0",
    "three": "^0.84.0",
    "three-bmfont-text": "^2.2.1",
    "three-text2d": "^0.3.0",
    "three.meshline": "^1.0.1",
    "tween.js": "^16.3.5"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment