Skip to content

Commit

Permalink
setup build
Browse files Browse the repository at this point in the history
  • Loading branch information
voronianski committed Aug 14, 2016
1 parent a0eea58 commit fbfa830
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 3 deletions.
44 changes: 44 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"extends": "eslint:recommended",

env: {
"browser": true,
"mocha": true,
"node": true
},

rules: {
"strict": 0,
"quotes": [2, "single"],
"indent": [2, 2, {SwitchCase: 1}],
"semi": [2, "always"],
"no-underscore-dangle": 0,
"no-unused-vars": 1,
"no-unused-expressions": 0,
"new-cap": 0,
"no-extra-boolean-cast": 0,
"yoda": 0,
"no-empty": 0,
"no-use-before-define": 0,
"camelcase": 0,
"object-curly-spacing": 0,
"array-bracket-spacing": 0,
"max-len": 0,
"comma-dangle": [2, "never"],
"space-before-function-paren": 0,
"arrow-body-style": 0,
"no-param-reassign": 0,
"consistent-return": 0,
"no-console": 0,
"no-void": 0,
"func-names": 0,
"no-nested-ternary": 0,
"quote-props": 0,
"space-infix-ops": 0,
"prefer-const": 0,
"prefer-template": 0,
"spaced-comment": 0,
"prefer-rest-params": 0,
"no-unreachable": 0
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.DS_Store
node_modules
*.log
build
game.zip
build.zip
20 changes: 17 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
"name": "no-name-game",
"name": "voronianski-js13k-2016",
"version": "1.0.0",
"description": "---",
"main": "dist/bundle.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"clean": "rm -rf build/; mkdir -p build",
"build": "NODE_ENV=production webpack --config webpack.config --progress --colors",
"watch": "webpack --config webpack.config --colors --watch",
"test": "echo \"Error: no test specified\" && exit 0",
"zip": "cd build; zip -r ../build.zip .; cd ..; wc -c build.zip",
"lint": "eslint ./src --fix",
"package": "npm run clean && npm run build && npm run zip",
"prepush": "npm run lint"
},
"repository": {
"type": "git",
Expand All @@ -15,5 +22,12 @@
"bugs": {
"url": "https://github.com/voronianski-on-games/js13kGames-2016/issues"
},
"homepage": "https://github.com/voronianski-on-games/js13kGames-2016#readme"
"homepage": "https://github.com/voronianski-on-games/js13kGames-2016#readme",
"devDependencies": {
"compression-webpack-plugin": "^0.3.1",
"eslint": "^3.3.0",
"html-webpack-plugin": "^2.22.0",
"husky": "^0.11.6",
"webpack": "^1.13.1"
}
}
1 change: 1 addition & 0 deletions src/engine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('engine');
Empty file removed src/index.html
Empty file.
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('./engine');
console.log('game will be here');
48 changes: 48 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use strict';

var env = process.env.NODE_ENV || 'development';
var webpack = require('webpack');
var path = require('path');
var HtmlPlugin = require('html-webpack-plugin');

var plugins = [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(env)
}
}),
new HtmlPlugin({
title: 'voronianski-js13k'
})
];

if ('production' === env) {
plugins = plugins.concat([
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false },
output: { comments: false }
}),
new webpack.NoErrorsPlugin()
]);
}

module.exports = {
devtool: 'eval',

entry: {
app: './src/main'
},

output: {
path: path.join(__dirname, 'build'),
filename: 'b.js'
},

plugins: plugins,

resolve: {
extensions: ['', '.js', 'json']
}
};

0 comments on commit fbfa830

Please sign in to comment.