meowio/jsnes/webpack.config.js

38 lines
701 B
JavaScript
Raw Normal View History

var path = require("path");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
module.exports = {
entry: {
jsnes: "./src/index.js",
"jsnes.min": "./src/index.js",
},
devtool: "source-map",
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].js",
library: "jsnes",
libraryTarget: "umd",
umdNamedDefine: true,
},
module: {
rules: [
{
test: /\.js$/,
enforce: "pre",
exclude: /node_modules/,
use: [
{
loader: "eslint-loader",
},
],
},
],
},
plugins: [
new UglifyJsPlugin({
include: /\.min\.js$/,
sourceMap: true,
}),
],
};