Skip to content

Instantly share code, notes, and snippets.

@surajp
Created November 6, 2019 21:20
Show Gist options
  • Save surajp/5b25a2aa7b024a785b68f15f5f1c4373 to your computer and use it in GitHub Desktop.
Save surajp/5b25a2aa7b024a785b68f15f5f1c4373 to your computer and use it in GitHub Desktop.
basic webpack config
const path = require('path');
module.exports = {
mode: "production",
entry: "./src/index",
output: {
// options related to how webpack emits results
path: path.resolve(__dirname, "dist"), // string
// the target directory for all output files
// must be an absolute path (use the Node.js path module)
filename: "bundle.js", // string
// the filename template for entry chunks
publicPath: "/assets/", // string
// the url to the output directory resolved relative to the HTML page
library: "MyLibrary", // string,
// the name of the exported library
libraryTarget: "umd", // universal module definition
// the type of the exported library
/* Advanced output configuration (click to show) */
/* Expert output configuration (on own risk) */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment