3 Star 0 Fork 0

孙锐/trafficMeteo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.production.config.js 2.13 KB
一键复制 编辑 原始数据 按行查看 历史
Sun Rui 提交于 2017-11-20 16:52 . timeLine controls animation
const path = require('path');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
app: './index.js',
vendor: ['dot']
},
externals: {
echarts: 'window.echarts',
$: 'jQuery'
},
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '',
filename: '[name].[hash:8].js',
//filename: '[name].[hash:8].js'
},
module: {
rules: [{
test: /\.css$/,
use: ExtractTextPlugin.extract({fallback: 'style-loader', use: 'css-loader!autoprefixer-loader'})
},
{
test: /\.html$/,
use: [
'html-loader'
]
},
{
test: /\.js$/,
exclude: /node_modules/,
use: [{
loader: 'babel-loader',
options: {
presets: ['env']
}
}],
},
{
test: /\.(png|jpg|gif)$/,
use: {
loader: 'url-loader',
options: {
limit: 8192,
name: 'images/[name].[ext]?v=[hash:8]'
}
},
},
]
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
}),
new CleanWebpackPlugin(['dist']),
new UglifyJSPlugin(),
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor', 'manifest']
}),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'indexTmp.html',
}),
// new webpack.HotModuleReplacementPlugin(),
new ExtractTextPlugin('styles.css'),
new CopyWebpackPlugin([{
from: __dirname + '/minemap.js'
}])
]
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sunrui1992/trafficMeteo.git
git@gitee.com:sunrui1992/trafficMeteo.git
sunrui1992
trafficMeteo
trafficMeteo
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385