jichoi / lms_front star
홍아랑 홍아랑 08-21
240821 홍아랑 오류 해결 (webpack.config 수정)
@daac7f2073fcbca018adf8f9be5888bec8f77978
package-lock.json
--- package-lock.json
+++ package-lock.json
@@ -20,6 +20,7 @@
         "file-loader": "6.2.0",
         "fs": "0.0.1-security",
         "new-line": "^1.1.1",
+        "path-browserify": "^1.0.1",
         "pg": "8.8.0",
         "url-loader": "4.1.1",
         "vue": "3.2.40",
@@ -3729,6 +3730,11 @@
         "node": ">= 0.8"
       }
     },
+    "node_modules/path-browserify": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
+      "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="
+    },
     "node_modules/path-exists": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
package.json
--- package.json
+++ package.json
@@ -15,6 +15,7 @@
     "file-loader": "6.2.0",
     "fs": "0.0.1-security",
     "new-line": "^1.1.1",
+    "path-browserify": "^1.0.1",
     "pg": "8.8.0",
     "url-loader": "4.1.1",
     "vue": "3.2.40",
webpack.config.js
--- webpack.config.js
+++ webpack.config.js
@@ -1,44 +1,54 @@
 const { VueLoaderPlugin } = require("vue-loader");
 
-const {PROJECT_NAME, BASE_DIR, SERVICE_STATUS} = require('./Global');
+const { PROJECT_NAME, BASE_DIR, SERVICE_STATUS } = require("./Global");
 
 module.exports = {
-  
   name: PROJECT_NAME,
   mode: SERVICE_STATUS,
-  devtool: 'eval',
+  devtool: "eval",
 
   entry: {
-    app: [`${BASE_DIR}/client/views/index.js`]
+    app: [`${BASE_DIR}/client/views/index.js`],
   },
 
   module: {
-    
-    rules: [{
-      test: /\.vue?$/,
-      loader: 'vue-loader',
-    }, {
-      test: /\.(js|jsx)?$/,
-      loader: 'babel-loader',
-    }, {
-      test: /\.css$/,
-      use: ['vue-style-loader', 'css-loader']
-    }, {
-      test: /\.(jpe?g|png|gif|svg|ttf|eot|woff|woff2)$/i,
-      use: [{
-        loader:'url-loader',
-        options:{
-          limit:8192,
-          fallback:require.resolve('file-loader')
-        }
-      }]
-    }],
+    rules: [
+      {
+        test: /\.vue?$/,
+        loader: "vue-loader",
+      },
+      {
+        test: /\.(js|jsx)?$/,
+        loader: "babel-loader",
+      },
+      {
+        test: /\.css$/,
+        use: ["vue-style-loader", "css-loader"],
+      },
+      {
+        test: /\.(jpe?g|png|gif|svg|ttf|eot|woff|woff2)$/i,
+        use: [
+          {
+            loader: "url-loader",
+            options: {
+              limit: 8192,
+              fallback: require.resolve("file-loader"),
+            },
+          },
+        ],
+      },
+    ],
   },
 
   plugins: [new VueLoaderPlugin()],
 
   output: {
-    path: `${BASE_DIR}/client/build`,	// __dirname: webpack.config.js 파일이 위치한 경로
-    filename: 'bundle.js'
+    path: `${BASE_DIR}/client/build`, // __dirname: webpack.config.js 파일이 위치한 경로
+    filename: "bundle.js",
   },
-}
(파일 끝에 줄바꿈 문자 없음)
+  resolve: {
+    fallback: {
+      path: require.resolve("path-browserify"),
+    },
+  },
+};
Add a comment
List