forked from PeachScript/vue-infinite-loading
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
60 lines (57 loc) · 1.35 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
'vue-infinite-loading': './src/index.js'
},
output: {
path: path.join(__dirname, './dist'),
filename: '[name].js',
publicPath: '/',
library: 'VueInfiniteLoading',
libraryTarget: 'umd'
},
resolve: {
extensions: ['.js', '.vue'],
alias: {
'vue$': 'vue/dist/vue.min.js'
}
},
module: {
rules: [
{
test: /\.(vue|js)$/,
enforce: 'pre',
include: [path.join(__dirname, './src'), path.join(__dirname, './test')],
loader: 'eslint-loader',
options: {
formatter: require('eslint-friendly-formatter')
}
},
{
test: /\.js$/,
include: [path.join(__dirname, './src'), path.join(__dirname, './test')],
loader: 'babel-loader'
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
postcss: [require('autoprefixer')]
}
}
]
}
};
if (process.env.NODE_ENV !== 'production') {
// development configurations
module.exports.plugins = [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './example/index.html',
inject: false
})
];
module.exports.devtool = '#cheap-module-eval-source-map';
}