-
Notifications
You must be signed in to change notification settings - Fork 18
/
webpack.config.js
58 lines (52 loc) · 1.7 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
const glob = require('glob');
const path = require('path');
const fieldtypes = {};
glob.sync(path.join(__dirname, 'fieldtypes/*/*.vue')).forEach(function (file) {
let type = path.basename(file, '.vue');
fieldtypes['formmaker-' + type] = './fieldtypes/' + type + '/' + type + '.vue';
});
module.exports = [
{
entry: fieldtypes,
output: {
filename: './app/bundle/[name].js',
},
module: {
loaders: [
{test: /\.vue$/, loader: 'vue',},
{test: /\.js/, loader: 'babel', query: {presets: ['es2015',],},},
],
},
},
{
entry: {
/*pagekit addons*/
'settings': './app/components/settings.vue',
'link-formmaker': './app/components/link-formmaker.vue',
'widget-formmaker': './app/components/widget-formmaker.vue',
'widget-siteform': './app/components/widget-siteform.vue',
/*frontpage views*/
'formmaker': './app/views/form.js',
/*admin views*/
'form-edit': './app/views/admin/edit.js',
'form-submissions': './app/views/admin/submissions.js',
'forms': './app/views/admin/forms.js',
},
output: {
filename: './app/bundle/[name].js',
},
externals: {
'lodash': '_',
'jquery': 'jQuery',
'uikit': 'UIkit',
'vue': 'Vue',
},
module: {
loaders: [
{test: /\.vue$/, loader: 'vue',},
{test: /\.html$/, loader: 'vue-html',},
{test: /\.js/, loader: 'babel', query: {presets: ['es2015',],},},
],
},
},
];