-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.000
71 lines (61 loc) · 1.57 KB
/
webpack.config.000
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
61
62
63
64
65
66
67
68
69
70
71
/**
* @fileOverview webpack config
* @author: burning <www.cafeinit.com>
* @date: 2016-09-11
*/
var path = require('path')
var webpack = require('webpack')
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
entry: {
'cafeinit-vue': './src/js/main.js',
'cafeinit-vue-amazeui': './src/js/mainForAmazeUI.js',
'cafeinit-vue-bootstrap': './src/js/mainForBootstrap.js'
},
output: {
path: './dist/js',
filename: '[name].js',
library: 'CafeinitVue',
libraryTarget: 'var' // Export by setting a variable: var Library = xxx (default)
},
module: {
loaders: [
{
// use vue-loader for *.vue files
test: /\.vue$/,
loader: 'vue',
options: {
// vue-loader options go here
}
},
{
// use babel-loader for *.js files
test: /\.js$/,
loader: 'babel',
// important: exclude files in node_modules
// otherwise it's going to be really slow!
exclude: /node_modules/
},
{
// use css-loader for *.css files
test: /\.css$/,
loader: 'style!css'
}
]
},
resolve: {
extensions: ['', '.js', '.vue'],
fallback: [path.join(__dirname, '../node_modules')],
alias: {
'vue$': 'vue/dist/vue'
}
},
devtool: '#eval-source-map',
// if you are using babel-loader directly then
// the babel config block becomes required.
babel: {
presets: ['es2015'],
plugins: ['transform-runtime']
},
// plugins: [new BundleAnalyzerPlugin()]
}