1 Star 0 Fork 1

Miller/zarm-web

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.pro.js 3.02 KB
一键复制 编辑 原始数据 按行查看 历史
Jerome Lin 提交于 2016-07-18 19:16 . html plugins
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var HtmlWebpackPlugin = require('html-webpack-plugin');
var config = require('./webpack.config.base');
config.entry = {
index: [
'./examples/index.js'
]
};
// github gh-pages dir http://xxxx.com/dragon-ui/
config.output.publicPath = './';
config.module.loaders.push({
test: /\.(js|jsx)$/,
loader: 'babel',
exclude: /node_modules/
});
config.plugins.push(new ExtractTextPlugin('stylesheet/[name].css', {
allChunks: true
}));
config.plugins.push(new webpack.optimize.CommonsChunkPlugin({
name: 'vendors'
}));
config.plugins.push(new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
},
__DEBUG__: true
}));
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
output: {
comments: false,
}
}));
for (var key in config.entry) {
if (key == 'vendors') {
continue;
}
config.plugins.push(new HtmlWebpackPlugin({
template: './examples/' + key + '.html',
filename: key + '.html',
chunks: ['vendors', key]
}));
}
module.exports = config;
// module.exports = {
// entry: {
// index: ['./examples/index.js', './examples/index.html']
// },
// output: {
// path: path.join(process.cwd(), 'assets'),
// filename: 'js/[name].min.js',
// chunkFilename: 'js/[name].[chunkhash:8].min.js',
// publicPath: './'
// },
// module: {
// loaders: [
// {
// test: /\.(js|jsx)$/,
// loader: 'react-hot!babel',
// exclude: /node_modules/
// },
// {
// test: /\.scss$/,
// loader: ExtractTextPlugin.extract("style-loader", "css?sourceMap&-minimize!autoprefixer!sass?sourceMap")
// // loader: 'style!css!autoprefixer!sass'
// },
// {
// test: /\.css$/,
// loader: ExtractTextPlugin.extract("style-loader", "css?sourceMap&-minimize!autoprefixer")
// // loader: 'style!css!autoprefixer'
// },
// {
// test: /\.(png|jpg|jpeg|gif)$/,
// loader: 'url-loader?limit=8192&name=images/[hash:8].[name].[ext]'
// },
// {
// test: /\.(woff|woff2|ttf|eot|svg)$/,
// loader: 'file-loader?name=fonts/[name].[ext]'
// },
// {
// test: /\.(html)$/,
// loader: 'file-loader?name=[name].[ext]'
// }
// ]
// },
// plugins: [
// new ExtractTextPlugin('stylesheet/[name].css', {
// allChunks: true
// }),
// new webpack.optimize.CommonsChunkPlugin({
// name: 'vendors'
// }),
// new webpack.optimize.OccurenceOrderPlugin(),
// new webpack.NoErrorsPlugin(),
// new webpack.DefinePlugin({
// "process.env": {
// NODE_ENV: JSON.stringify("production")
// },
// __DEBUG__: true
// }),
// // 压缩JS
// new webpack.optimize.UglifyJsPlugin({
// compress: {
// warnings: false
// }
// })
// ],
// resolve: {
// extensions: ['', '.js', '.jsx']
// }
// };
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/miller_wang/zarm-web.git
git@gitee.com:miller_wang/zarm-web.git
miller_wang
zarm-web
zarm-web
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385