commit 000b64f00403d766b1fc157a619616fc9d49c982 Author: Nathan Kunicki Date: Fri Dec 18 02:08:45 2015 +0000 Initial project setup diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d6c44a9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +dist/ +node_modules/ \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..449691b --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +save-exact=true \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..0bf16e8 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,94 @@ +"use strict"; + +var gulp = require("gulp"), + path = require("path"), + gutil = require("gulp-util"), + webpack = require("webpack"); + + +var build = function (options, callback) { + + var plugins = []; + + if (options.minify) { + plugins = [ + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + }, + output: { + comments: false, + semicolons: true + } + }) + ]; + } + + webpack({ + entry: path.join(__dirname, "src", "index.js"), + bail: !options.watch, + watch: options.watch, + devtool: "source-map", + plugins: plugins, + output: { + path: path.join(__dirname, "dist"), + filename: "index.js" + }, + module: { + loaders: [{ + loader: "babel-loader", + test: /\.js$/, + include: [ + path.join(__dirname, "src") + ] + }] + } + }, (error, stats) => { + + if (error) { + + var pluginError = new gutil.PluginError("webpack", error); + + if (callback) { + callback(pluginError); + } else { + gutil.log("[Webpack]", pluginError); + } + + return; + + } + + gutil.log("[Webpack]", stats.toString()); + + if (callback) { + callback(); + } + + }); + +}; + + +gulp.task("build-dev", (callback) => { + build({ + watch: false, + minify: false + }, callback); +}); + + +gulp.task("build", (callback) => { + build({ + watch: false, + minify: true + }, callback); +}); + + +gulp.task("watch", () => { + build({ + watch: true, + minify: false + }); +}); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..6f9cb2c --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "momentumengine", + "version": "0.0.1", + "description": "An ES6 game and animation engine.", + "main": "dist/index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Nathan Kunicki ", + "license": "ISC", + "engines": { + "node": "^4.2.3" + }, + "devDependencies": { + "babel-core": "6.3.17", + "babel-loader": "6.2.0", + "gulp": "3.9.0", + "gulp-util": "3.0.7", + "webpack": "1.12.9" + } +} \ No newline at end of file diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..635625a --- /dev/null +++ b/src/index.js @@ -0,0 +1 @@ +console.log("Hello world!"); \ No newline at end of file