diff --git a/.gitignore b/.gitignore index b9969b15..a3e69d17 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ -/dist/ -/local-roms/ -jsnes.tmproj ._* .DS_Store -/tmp +/dist +/local-roms /node_modules +/tmp diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..57311f2a --- /dev/null +++ b/.npmignore @@ -0,0 +1,2 @@ +/local-roms +/tmp diff --git a/package.json b/package.json index ec583c9f..d5cce761 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "scripts": { "build": "webpack", "test": "mocha ./test/*.spec.js", - "test:watch": "mocha -w ./test/*.spec.js" + "test:watch": "mocha -w ./test/*.spec.js", + "prepublish": "npm run build" }, "devDependencies": { "chai": "^3.5.0", diff --git a/webpack.config.js b/webpack.config.js index 1f45636d..426afa1b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,11 +2,14 @@ var path = require("path"); var webpack = require("webpack"); module.exports = { - entry: "./src/index.js", + entry: { + "jsnes": "./src/index.js", + "jsnes.min": "./src/index.js", + }, devtool: "source-map", output: { path: path.resolve(__dirname, "dist"), - filename: "jsnes.min.js", + filename: "[name].js", library: "jsnes", libraryTarget: "umd", umdNamedDefine: true @@ -27,6 +30,7 @@ module.exports = { }, plugins: [ new webpack.optimize.UglifyJsPlugin({ + include: /\.min\.js$/, sourceMap: true }) ]