Quellcode durchsuchen

add some reposity

night-cherry vor 3 Wochen
Ursprung
Commit
37018cd190
2 geänderte Dateien mit 18 neuen und 1 gelöschten Zeilen
  1. 1 1
      mv.sh
  2. 17 0
      webpack.config.js

+ 1 - 1
mv.sh

@@ -8,7 +8,7 @@ mkdir /usr/share/nginx/ancientapes/node_test
 #-----------------
 #cp ./index.html ./dist/
 # cp ./dist/bundle.js /usr/share/nginx/ancientapes/node_test/index.js
-cp ./dist/* /usr/share/nginx/ancientapes/node_test/
+cp ./dist/* /usr/share/nginx/ancientapes/node_test/ -r
 #mkdir /usr/share/nginx/ancientapes/node_test/vue
 #cp ./vue /usr/share/nginx/ancientapes/node_test/vue -r
 #cp ./js /usr/share/nginx/ancientapes/node_test/js -r

+ 17 - 0
webpack.config.js

@@ -22,6 +22,23 @@ module.exports={
   module:{
     rules:[
       {
+        test: /\.html  \)/,
+        use: [
+          {
+            loader: 'html-loader',
+            options: {  // [!code focus]
+              // 配置 HTML 中资源引用的处理规则
+              sources: { // [!code focus]
+                list: [ // [!code focus]
+                  { tag: 'img', attribute: 'src', type: 'src' }, // 处理 <img src>
+                  { tag: 'a', attribute: 'href', type: 'src' }   // 处理 <a href> // [!code focus]
+                ] // [!code focus]
+              } // [!code focus]
+            } // [!code focus]
+          }
+        ]
+      },
+      {
         test:/\.css$/i,
         use:["style-loader","css-loader"],
       },