Parcourir la source

Video 3: output.path

Frederic G. MARAND il y a 5 ans
Parent
commit
f5d44e44ef
2 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 1 0
      .gitignore
  2. 4 1
      webpack.config.js

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
 .idea/workspace.xml
 
+build
 node_modules

+ 4 - 1
webpack.config.js

@@ -1,6 +1,9 @@
+const path = require("path"); // NodeJS builtin.
+
 module.exports = {
   entry: "./src/index.js",
   output: {
-    filename: "bundle.js"
+    filename: "bundle.js",
+    path: path.join(__dirname, "build") // path must be absolute.
   }
 };