1 Star 0 Fork 31

lvtao/vue-aplayer for electron-vue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.demo.config.js 1.94 KB
一键复制 编辑 原始数据 按行查看 历史
SevenOutman 提交于 2018-05-26 15:24 . add favicon to demo page
var path = require('path')
var webpack = require('webpack')
var HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: './src/demo/main.js',
output: {
path: path.resolve(__dirname, 'demo'),
filename: 'demo.js',
},
module: {
rules: [
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [path.resolve(__dirname, 'src')],
options: {
formatter: require('eslint-friendly-formatter'),
emitWarning: true
}
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
js: 'babel-loader?babelrc',
scss: 'style-loader!css-loader!postcss-loader!sass-loader'
}
}
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.(png|jpg)$/,
loader: 'url-loader?limit=40000'
},
{
test: /\.svg$/,
loader: 'svg-inline-loader'
},
{
test: /\.html$/,
loader: 'vue-html-loader'
}
]
},
devtool: '#eval-source-map',
devServer: {
contentBase: path.resolve(__dirname, 'demo'),
compress: true,
port: 3000,
disableHostCheck: true
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'src/demo/index.html',
favicon: 'src/demo/favicon.ico'
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: `"${process.env.NODE_ENV}"`
},
VERSION: JSON.stringify(require("./package.json").version)
}),
]
}
if (process.env.NODE_ENV === 'production') {
module.exports.output.publicPath = '/'
module.exports.devtool = '#source-map'
// http://vuejs.github.io/vue-loader/workflow/production.html
module.exports.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
})
)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/yy412/electron-vue-player.git
git@gitee.com:yy412/electron-vue-player.git
yy412
electron-vue-player
vue-aplayer for electron-vue
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385