1 Star 0 Fork 20

JavaLeung/ScaffoldClient

forked from teambp/ScaffoldClient 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 2.12 KB
一键复制 编辑 原始数据 按行查看 历史
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var path = require('path');
module.exports = {
devtool: '#source-map',
entry: {
index: './src/client/index',
vendor: ['react', 'react-dom', 'react-router', 'antd', 'dva', 'prop-types']
},
output: {
filename: '[name].bundle.js',
path: path.join(__dirname, './src/static'),
publicPath: '/static/',
},
resolve: {
extensions: [' ', '.css', '.scss', '.sass', '.less', '.js', '.json']
},
module: {
loaders: [
{
test: /\.json$/,
loader: "json-loader"
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.less$/,
loader: ExtractTextPlugin.extract({ fallback: "style-loader", use: "css-loader!less-loader" })
},
{
test: /\.css$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract(
'css-loader?sourceMap&modules&localIdentName=[local]'
)
},
{
test: /\.css$/,
include: /node_modules/,
loader: ExtractTextPlugin.extract(
'css-loader?sourceMap&modules&localIdentName=[local]'
)
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
output: {
comments: false,
},
compress: {
warnings: false
}
}),
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor'],
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify("production"),
},
}),
new ExtractTextPlugin("[name].css", {
disable: false,
allChunks: true,
})
]
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/javaleung/ScaffoldClient.git
git@gitee.com:javaleung/ScaffoldClient.git
javaleung
ScaffoldClient
ScaffoldClient
master

搜索帮助