38 lines
701 B
JavaScript
38 lines
701 B
JavaScript
|
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,
|
||
|
}),
|
||
|
],
|
||
|
};
|