代码拉取完成,页面将自动刷新
同步操作将从 CodingMr.Zhou/Peer-To-Peer 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
var webpack = require("webpack");
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var env_prod = process.env.NODE_ENV === 'production';
console.log('NODE_ENV:::::' + process.env.NODE_ENV);
var output_options = {
path: __dirname + '/web-src/assets/',
filename: '[name].js',
chunkFilename: '[name].js',
publicPath: '/assets/'
};
var plugins_options = [
new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.js"),
new ExtractTextPlugin('[name].css', {allChunks: true}),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify(env_prod ? "production" : 'develop')
}
}),
new HtmlWebpackPlugin({
title: 'Home · Peer To Peer',
filename: '../../views/portal.jade',
template: 'web-src/html/base.jade',
chunks: ['main', 'vendor'],
minify: env_prod ? {
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeRedundantAttributes: true,
removeEmptyAttributes: true
} : false,
hash: true
})
];
if(!env_prod){
plugins_options.push(new webpack.SourceMapDevToolPlugin({
test: /\.(js|css)($|\?)/i,
filename: 'maps/[file].map'
}));
}
if(env_prod){
plugins_options.push(new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}));
}
var preLoaders_options = [];
if(!env_prod){
preLoaders_options.push({
test: /\.js$/, // include .js files
exclude: /node_modules/, // exclude any and all files in the node_modules folder
loader: "jshint-loader"
});
}
var postLoaders_options = [];
if(env_prod) {
postLoaders_options.push({
loader: 'transform?envify'
});
}
module.exports = {
entry: {
main: __dirname + '/web-src/js/components/page/Main.react.jsx',
vendor: [
'react',
'react/addons',
'react-router',
'react-bootstrap',
'react-tween-state',
'keymirror',
'flux',
'lodash',
'immutable',
'events',
'classnames',
'jwt-decode',
'inherits',
'reqwest',
'when',
'store']
},
output: output_options,
plugins: plugins_options,
debug: !env_prod,
cache: !env_prod,
watch: !env_prod,
module: {
preLoaders: preLoaders_options,
postLoaders: postLoaders_options,
loaders: [{
test: /\.jsx$/,
exclude: /node_modules/,
loader: 'jsx-loader?insertPragma=React.DOM&harmony!strict'
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: 'strict'
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader?sourceMap!autoprefixer-loader")
},{
test: /\.less$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader?sourceMap!autoprefixer-loader!less-loader")
}, {
test: /\.(woff|woff2|ttf|eot|svg)$/,
loader: "url-loader"
}, {
test: /\.(png|jpg|gif)$/,
loader: 'url-loader?limit=8192'
}]
},
jshint: {
// This option prohibits the use of explicitly undeclared variables. This option is very useful for spotting leaking and mistyped variables.
undef: true,
// This option defines globals exposed by modern browsers: all the way from good old document and navigator to the HTML5 FileReader and other new developments in the browser world.
browser: true,
// This option defines globals that are usually used for logging poor-man's debugging: console, alert, etc. It is usually a good idea to not ship them in production because, for example, console.log breaks in legacy versions of Internet Explorer.
devel: false,
// This option warns when you define and never use your variables. It is very useful for general code cleanup, especially when used in addition to undef.
unused: true,
// jshint errors are displayed by default as warnings
// set emitErrors to true to display them as errors
emitErrors: true,
// jshint to not interrupt the compilation
// if you want any file with jshint errors to fail
// set failOnHint to true
failOnHint: true
},
resolve: {
extensions: ['', '.js', '.jsx']
}
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。