vue-calendar-ui
Version:
一款高效、简洁、功能丰富、宽度可自适应的pc端考勤日历插件
80 lines (77 loc) • 1.85 kB
JavaScript
var path = require('path')
var webpack = require('webpack')
module.exports = {
entry: process.env.NODE_ENV==='development'?'./src/main.js':'./lib/index.js',//开发和打包入口不同,
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: 'vue-calendar-ui.js',
libraryTarget: 'umd',//重要,输出格式,不然到时候引入不了
},
module: {
rules: [
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
],
}, {
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
}
// other vue-loader options go here
}
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
},
extensions: ['*', '.js', '.vue', '.json']
},
devServer: {
historyApiFallback: true,
noInfo: true,
overlay: true
},
performance: {
hints: false
},
devtool: '#eval-source-map'
}
if (process.env.NODE_ENV === 'production') {
module.exports.devtool = '#source-map'
// http://vue-loader.vuejs.org/en/workflow/production.html
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
])
}