|
@@ -2,6 +2,8 @@ const webpack = require('webpack');
|
|
|
const path = require('path');
|
|
|
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
+const WebpackDevServer = require('webpack-dev-server');
|
|
|
+
|
|
|
|
|
|
let theme = {
|
|
|
'@primary-color': '#58a3ff',
|
|
@@ -10,44 +12,44 @@ let theme = {
|
|
|
|
|
|
module.exports = {
|
|
|
entry: {
|
|
|
- 'user/index': ['webpack-dev-server/client?http://0.0.0.0:80', // WebpackDevServer host and port
|
|
|
+ 'user/index': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
|
|
|
'webpack/hot/only-dev-server',
|
|
|
'./js/user/index.js'
|
|
|
],
|
|
|
- 'user/login': ['webpack-dev-server/client?http://0.0.0.0:80', // WebpackDevServer host and port
|
|
|
- 'webpack/hot/only-dev-server',
|
|
|
- './js/user/login.js'
|
|
|
+ 'user/login': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
|
|
|
+ 'webpack/hot/only-dev-server',
|
|
|
+ './js/user/login.js'
|
|
|
],
|
|
|
- 'user/signIn': ['webpack-dev-server/client?http://0.0.0.0:80', // WebpackDevServer host and port
|
|
|
- 'webpack/hot/only-dev-server',
|
|
|
- './js/user/signIn.js'
|
|
|
+ 'user/signIn': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
|
|
|
+ 'webpack/hot/only-dev-server',
|
|
|
+ './js/user/signIn.js'
|
|
|
],
|
|
|
//user-account
|
|
|
- 'user/account/index': ['webpack-dev-server/client?http://0.0.0.0:80', // WebpackDevServer host and port
|
|
|
- 'webpack/hot/only-dev-server',
|
|
|
- './js/user/account/index.js'
|
|
|
- ],
|
|
|
- 'user/account/set': ['webpack-dev-server/client?http://0.0.0.0:80', // WebpackDevServer host and port
|
|
|
- 'webpack/hot/only-dev-server',
|
|
|
- './js/user/account/set.js'
|
|
|
- ],
|
|
|
- 'user/account/services': ['webpack-dev-server/client?http://0.0.0.0:80', // WebpackDevServer host and port
|
|
|
- 'webpack/hot/only-dev-server',
|
|
|
- './js/user/account/services.js'
|
|
|
- ],
|
|
|
+ 'user/account/index': ['webpack-dev-server/client?http://127.0.0.1:80', // 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
|
|
|
+ '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
|
|
|
+ 'webpack/hot/only-dev-server',
|
|
|
+ './js/user/account/services.js'
|
|
|
+ ],
|
|
|
|
|
|
|
|
|
//admin
|
|
|
- 'admin/index': ['webpack-dev-server/client?http://0.0.0.0:80', // WebpackDevServer host and port
|
|
|
- 'webpack/hot/only-dev-server',
|
|
|
- './js/admin/index.js'
|
|
|
+ 'admin/index': ['webpack-dev-server/client?http://127.0.0.1:80', // WebpackDevServer host and port
|
|
|
+ 'webpack/hot/only-dev-server',
|
|
|
+ './js/admin/index.js'
|
|
|
]
|
|
|
- //vendors: ['jquery','antd']
|
|
|
- //path.resolve(__dirname, './js/index.js'),
|
|
|
+ //vendors: ['jquery','antd']
|
|
|
+ //path.resolve(__dirname, './js/index.js'),
|
|
|
},
|
|
|
output: {
|
|
|
path: path.resolve(__dirname, './build'),
|
|
|
- filename: '[name].js',
|
|
|
+ filename: '[name].js'
|
|
|
},
|
|
|
module: {
|
|
|
loaders: [{
|
|
@@ -65,8 +67,8 @@ module.exports = {
|
|
|
//loaders: ['babel-loader?presets[]=es2015,presets[]=react']
|
|
|
},
|
|
|
//{
|
|
|
- //test: /\.module\.less$/,
|
|
|
- //loader: 'style!css!less?{"modifyVars":{"@primary-color": "#1DA57A"}}'
|
|
|
+ //test: /\.module\.less$/,
|
|
|
+ //loader: 'style!css!less?{"modifyVars":{"@primary-color": "#1DA57A"}}'
|
|
|
//},
|
|
|
{
|
|
|
test: /\.css$/,
|
|
@@ -94,47 +96,69 @@ module.exports = {
|
|
|
title: '用户首页',
|
|
|
filename: 'user/index.html',
|
|
|
template: './template/template.html',
|
|
|
- chunks:['user/index','vendors']
|
|
|
+ chunks: ['user/index', 'vendors']
|
|
|
}),
|
|
|
new HtmlWebpackPlugin({
|
|
|
title: '用户登录',
|
|
|
filename: 'user/login.html',
|
|
|
template: './template/template.html',
|
|
|
- chunks:['user/login','vendors']
|
|
|
+ chunks: ['user/login', 'vendors']
|
|
|
}),
|
|
|
new HtmlWebpackPlugin({
|
|
|
title: '用户注册',
|
|
|
filename: 'user/signIn.html',
|
|
|
template: './template/template.html',
|
|
|
- chunks:['user/signIn','vendors']
|
|
|
+ chunks: ['user/signIn', 'vendors']
|
|
|
}),
|
|
|
//user-account
|
|
|
- new HtmlWebpackPlugin({
|
|
|
- title: '用户中心-首页',
|
|
|
- filename: 'user/account/index.html',
|
|
|
- template: './template/template.html',
|
|
|
- chunks:['user/account/index','vendors']
|
|
|
- }),
|
|
|
- new HtmlWebpackPlugin({
|
|
|
- title: '用户中心-设置',
|
|
|
- filename: 'user/account/set.html',
|
|
|
- template: './template/template.html',
|
|
|
- chunks:['user/account/set','vendors']
|
|
|
- }),
|
|
|
- new HtmlWebpackPlugin({
|
|
|
- title: '用户中心-科技服务',
|
|
|
- filename: 'user/account/services.html',
|
|
|
- template: './template/template.html',
|
|
|
- chunks:['user/account/services','vendors']
|
|
|
- }),
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
+ title: '用户中心-首页',
|
|
|
+ filename: 'user/account/index.html',
|
|
|
+ template: './template/template.html',
|
|
|
+ chunks: ['user/account/index', 'vendors']
|
|
|
+ }),
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
+ title: '用户中心-设置',
|
|
|
+ filename: 'user/account/set.html',
|
|
|
+ template: './template/template.html',
|
|
|
+ chunks: ['user/account/set', 'vendors']
|
|
|
+ }),
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
+ title: '用户中心-科技服务',
|
|
|
+ filename: 'user/account/services.html',
|
|
|
+ template: './template/template.html',
|
|
|
+ chunks: ['user/account/services', 'vendors']
|
|
|
+ }),
|
|
|
+
|
|
|
|
|
|
//admin
|
|
|
new HtmlWebpackPlugin({
|
|
|
- title: 'admin_index',
|
|
|
+ title: '管理员-首页',
|
|
|
filename: 'admin/index.html',
|
|
|
template: './template/template.html',
|
|
|
- chunks:['admin/index','vendors']
|
|
|
- })
|
|
|
+ chunks: ['admin/index', 'vendors']
|
|
|
+ }),
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
+ title: '管理员-登录',
|
|
|
+ filename: 'admin/login.html',
|
|
|
+ template: './template/template.html',
|
|
|
+ chunks: ['admin/login', 'vendors']
|
|
|
+ }),
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
+ title: '管理员-用户管理',
|
|
|
+ filename: 'admin/userManage.html',
|
|
|
+ template: './template/template.html',
|
|
|
+ chunks: ['admin/userManage', 'vendors']
|
|
|
+ }),
|
|
|
+ //admin-servicesManage
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
+ title: '管理员-科技服务管理-专利',
|
|
|
+ filename: 'admin/servicesManage/patent.html',
|
|
|
+ template: './template/template.html',
|
|
|
+ chunks: ['admin/servicesManage/patent', 'vendors']
|
|
|
+ }),
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//这个使用uglifyJs压缩你的js代码
|
|
|
//new webpack.optimize.UglifyJsPlugin({minimize: true}),
|