Initial project setup

This commit is contained in:
Nathan Kunicki 2015-12-18 02:08:45 +00:00
commit 000b64f004
5 changed files with 120 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.idea/
dist/
node_modules/

1
.npmrc Normal file
View File

@ -0,0 +1 @@
save-exact=true

94
gulpfile.js Normal file
View File

@ -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
});
});

21
package.json Normal file
View File

@ -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 <me@nathankunicki.com>",
"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"
}
}

1
src/index.js Normal file
View File

@ -0,0 +1 @@
console.log("Hello world!");