-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
96 lines (96 loc) · 2.38 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
const path = require('path');
const webpack = require('webpack');
const mode = process.env.NODE_ENV || 'development';
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
entry: {
'install': './src/install.js',
'style-guide': './src/style-guide.js',
'themes': './src/themes.js',
'theme': './src/theme.js',
'collection': './src/collection.js',
'collections': './src/collections.js',
'item': './src/item.js',
'items': './src/items.js',
'create-item': './src/create-item.js',
'navigation': './src/navigation.js',
'nav': './src/nav.js',
'create-navigation': './src/create-navigation.js',
'create-collection': './src/create-collection.js',
'settings': './src/settings.js',
'app': './src/app.js',
'apps': './src/apps.js',
'create-app': './src/create-app.js',
'users': './src/users.js',
'admin': './src/admin.js',
'login': './src/login.js',
'dashboard': './src/dashboard.js',
'404': './src/404.js',
},
devtool: 'source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new VueLoaderPlugin()
],
mode: 'development',
output: {
filename: '[name].bundle.js',
path: path.join(__dirname, '/client/admin/assets/'),
publicPath: '/admin/assets/'
},
devServer: {
contentBase: path.join(__dirname, '/client/admin/assets'),
watchContentBase: true,
proxy: [
{
context: ['/', '/admin'],
target: 'http://localhost:3000', //server and port to redirect to
secure: false //don't use https
}
],
overlay: {
warnings: true, // default false
errors: true, //default false
},
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: { loader: 'babel-loader' }
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.css$/,
use: [
{
loader: 'vue-style-loader'
},
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
importLoaders: 1,
}
},
{
loader: 'postcss-loader'
}
]
}
],
},
resolve: {
alias: {
vue: 'vue/dist/vue.js'
}
}
};