Pārlūkot izejas kodu

remove dllplugin

albertshaw 7 gadi atpakaļ
vecāks
revīzija
1a6c0ba0e3
4 mainītis faili ar 35 papildinājumiem un 37 dzēšanām
  1. 1 1
      package.json
  2. 1 1
      webpack-dll.config.js
  3. 9 11
      webpack.config.js
  4. 24 24
      webpack/entry.config.js

+ 1 - 1
package.json

@@ -13,7 +13,7 @@
     "buildtest": "webpack --progress --colors --env.deploy test",
     "buildstage": "webpack --progress --colors --env.deploy stage",
     "pro": "webpack --progress --colors --env.deploy prod",
-    "dev": "webpack-dev-server --port 80 --devtool eval --progress --colors --hot --content-base build --env.deploy watch"
+    "dev": "webpack-dev-server --port 8088 --devtool eval --progress --colors --hot --content-base build --env.deploy dev --env.watch watch"
   },
   "repository": {
     "type": "git",

+ 1 - 1
webpack-dll.config.js

@@ -21,7 +21,7 @@ module.exports = (function () {
     },
     entry: {
       dll: [
-        'react', 'react-dom', 'antd', 'jquery/src/ajax/xhr.js', 'jquery/src/ajax'
+        'react', 'react-dom', 'antd', 'jquery/src/ajax/xhr.js', 'jquery/src/ajax', 'antd/lib/style'
       ],
     },
     plugins: [

+ 9 - 11
webpack.config.js

@@ -12,27 +12,25 @@ let theme = {
     '@primary-color': '#58a3ff',
     '@link-color': '#58a3ff'
 };
-let isWatch = argv.env.deploy == 'watch';
+let isWatch = argv.env.watch == 'watch';
 let isDev = isWatch || argv.env.deploy == 'dev';
 
 module.exports = (function () {
-    var dllContext = path.resolve(dirVars.dllDir, './' + argv.env.deploy);
     let plugins = [
-        /* 配置好Dll */
-        new webpack.DllReferencePlugin({
-            context: dirVars.staticRootDir, // 指定一个路径作为上下文环境,需要与DllPlugin的context参数保持一致,建议统一设置为项目根目录
-            manifest: path.resolve(dllContext, 'manifest.json'), // 指定manifest.json
-            name: 'dll',  // 当前Dll的所有内容都会存放在这个参数指定变量名的一个全局变量下,注意与DllPlugin的name参数保持一致
+        //把入口文件里面的数组打包成verdors.js
+        new webpack.optimize.CommonsChunkPlugin({
+            name: 'vendors'
         }),
+        // /* 配置好Dll */
+        // new webpack.DllReferencePlugin({
+        //     context: dirVars.staticRootDir, // 指定一个路径作为上下文环境,需要与DllPlugin的context参数保持一致,建议统一设置为项目根目录
+        //     manifest: require('./dll/'+argv.env.deploy+'/manifest.json') // 指定manifest.json
+        // }),
         new ExtractTextPlugin({
             filename: "[name].css",
             disable: false,
             allChunks: true
         }),
-        //把入口文件里面的数组打包成verdors.js
-        new webpack.optimize.CommonsChunkPlugin({
-            name: 'vendors'
-        }),
         //user
         new HtmlWebpackPlugin({
             title: '用户首页',

+ 24 - 24
webpack/entry.config.js

@@ -29,103 +29,103 @@ module.exports = {
     'admin/achievement': './js/admin/achievement.js'
   },
   watch: {
-    'user/index': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/index': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/index.js'
     ],
-    'user/login': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/login': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/login.js'
     ],
-    'user/signIn': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/signIn': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/signIn.js'
     ],
-    'user/certify': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/certify': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/certify.js'
     ],
-    'user/groupCertify': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/groupCertify': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/groupCertify.js'
     ],
     //user-account
-    'user/account/index': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/account/index': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/index.js'
     ],
-    'user/account/set': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/account/set': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/set.js'
     ],
-    'user/account/services': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/account/services': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/services.js'
     ],
-    'user/account/achievement': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/account/achievement': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/achievement.js'
     ],
-    'user/account/demand': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'user/account/demand': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/user/account/demand.js'
     ],
     //admin
-    'admin/index': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/index': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/index.js'
     ],
-    'admin/login': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/login': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/login.js'
     ],
-    'admin/userManage': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/userManage': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/userManage.js'
     ],
-    'admin/demand': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/demand': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/demand.js'
     ],
-    'admin/achievement': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/achievement': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/achievement.js'
     ],
-    'admin/set': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/set': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/set.js'
     ],
     //admin-servicesManage
-    'admin/servicesManage/contract': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/servicesManage/contract': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/contract.js'
     ],
-    'admin/servicesManage/patent': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/servicesManage/patent': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/patent.js'
     ],
-    'admin/servicesManage/copyright': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/servicesManage/copyright': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/copyright.js'
     ],
-    'admin/servicesManage/highTech': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/servicesManage/highTech': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/highTech.js'
     ],
-    'admin/servicesManage/highTechInfo': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/servicesManage/highTechInfo': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/highTechInfo.js'
     ],
-    'admin/servicesManage/technology': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'admin/servicesManage/technology': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/admin/servicesManage/technology.js'
     ],
     //portal  门户
-    'portal/search/demand': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'portal/search/demand': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/portal/search/demand.js'
     ],
-    'portal/search/achievement': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
+    'portal/search/achievement': ['webpack-dev-server/client?http://127.0.0.1:8088', // WebpackDevServer host and port
       'webpack/hot/only-dev-server',
       './js/portal/search/achievement.js'
     ],