Browse Source

Video 1.4: using a paths module.

Frederic G. MARAND 4 years ago
parent
commit
a1242c434b
3 changed files with 10 additions and 3 deletions
  1. 3 1
      .idea/fundamentals3.iml
  2. 5 0
      build-utils/common-paths.js
  3. 2 2
      build-utils/webpack.common.js

+ 3 - 1
.idea/fundamentals3.iml

@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module type="WEB_MODULE" version="4">
   <component name="NewModuleRootManager">
-    <content url="file://$MODULE_DIR$/../fundamentals3" />
+    <content url="file://$MODULE_DIR$">
+      <excludeFolder url="file://$MODULE_DIR$/dist" />
+    </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
   </component>

+ 5 - 0
build-utils/common-paths.js

@@ -0,0 +1,5 @@
+const path = require("path"); // NodeJS builtin.
+
+module.exports = {
+  outputPath: path.resolve(__dirname, "../", "dist")
+};

+ 2 - 2
build-utils/webpack.common.js

@@ -1,10 +1,10 @@
-const path = require("path"); // NodeJS builtin.
+const commonPaths = require("./common-paths");
 
 const config = {
   entry: "./src/",
   output: {
     filename: "bundle.js",
-    path: path.join(__dirname, "../dist") // path must be absolute.
+    path: commonPaths.outputPath
   }
 };