webpack.config.js 369 B

1234567891011121314
  1. const path = require("path"); // NodeJS builtin.
  2. // Export a function returning config instead of a static config.
  3. // The purpose is to allow use of the environment.
  4. module.exports = env => {
  5. console.log(env);
  6. return {
  7. entry: "./src/",
  8. output: {
  9. filename: "bundle.js",
  10. path: path.join(__dirname, "dist") // path must be absolute.
  11. }
  12. };
  13. };