Browse Source

add some reposity

night-cherry 3 weeks ago
parent
commit
2231f6361d
2 changed files with 10 additions and 5 deletions
  1. 1 0
      utils/commonjs.js
  2. 9 5
      webpack.config.js

+ 1 - 0
utils/commonjs.js

@@ -8,3 +8,4 @@ module.exports={
   sign,
   sign,
   info
   info
 }
 }
+

+ 9 - 5
webpack.config.js

@@ -6,7 +6,9 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
 const { VueLoaderPlugin } = require('vue-loader');
 const { VueLoaderPlugin } = require('vue-loader');
 
 
 module.exports={
 module.exports={
-  entry:"./index.js",
+  entry:{
+    index:"./index.js",
+  },
   output:{
   output:{
     filename:"bundle.js",
     filename:"bundle.js",
     path:path.resolve(__dirname,"./dist")
     path:path.resolve(__dirname,"./dist")
@@ -39,9 +41,11 @@ module.exports={
     new VueLoaderPlugin(),
     new VueLoaderPlugin(),
     new CleanWebpackPlugin(),
     new CleanWebpackPlugin(),
     new HtmlWebpackPlugin({
     new HtmlWebpackPlugin({
-      inject:'body',
-      title:"webpack sample ",
-      template:"./index.html"
-    })
+      inject:'head',
+      title:"index page ",
+      template:"./index.html",
+      filename:"index.html",
+      chunks:['index'],
+    }),
   ]
   ]
 }
 }