3 Star 0 Fork 0

孙锐/trafficMeteo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.js 2.21 KB
一键复制 编辑 原始数据 按行查看 历史
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");
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'
},
// devtool: 'cheap-module-eval-source-map',
devtool: 'eval',
devServer: {
hot: true,
inline: true,
progress: true
},
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 ExtractTextPlugin('styles.css'),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'indexTmp.html',
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
]
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sunrui1992/trafficMeteo.git
git@gitee.com:sunrui1992/trafficMeteo.git
sunrui1992
trafficMeteo
trafficMeteo
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385