forked from simphony/simphony-remote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpackfile.js
80 lines (72 loc) · 2.25 KB
/
webpackfile.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
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var path = require("path");
var js = path.resolve(__dirname, "frontend");
module.exports = {
// Input files for the bundles of JS/CSS
entry: {
admin: path.resolve(js, "admin/main.js"),
user: path.resolve(js, "user/main.js"),
sharedDependencies: path.resolve(js, "sharedDependencies")
},
// Output bundle of JS
output: {
path: path.resolve(__dirname, "remoteappmanager/static/dist"),
filename: "[name].js"
},
// Aliases and file extensions supported
resolve: {
extensions: ["*", ".js", ".vue", ".css"],
alias: {
// CSS
"bootstrap-css": "admin-lte/bootstrap/css/bootstrap.min",
"font-awesome-css": "font-awesome/css/font-awesome.min",
"ionicons-css": "ionicons/dist/css/ionicons.min",
"admin-lte-css": "admin-lte/dist/css/AdminLTE.min",
"skin-black-css": "admin-lte/dist/css/skins/skin-black.min",
"skin-red-css": "admin-lte/dist/css/skins/skin-red.min",
"skin-blue-css": "admin-lte/dist/css/skins/skin-blue.min",
// JS
jquery: "admin-lte/plugins/jQuery/jquery-2.2.3.min",
bootstrap: "admin-lte/bootstrap/js/bootstrap.min",
vue: "vue/dist/vue.min",
"vue-router": "vue-router/dist/vue-router",
"admin-resources": path.resolve(js, "admin/admin-resources"),
"user-resources": path.resolve(js, "user/user-resources"),
gamodule: path.resolve(js, "gamodule"),
urlutils: path.resolve(js, "urlutils"),
utils: path.resolve(js, "utils"),
toolkit: path.resolve(js, "toolkit/toolkit"),
}
},
// Loaders for specific file extensions
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.vue$/,
use: {
loader: 'vue-loader'
}
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' })
},
{
test: /\.(eot|svg|ttf|woff|woff2|jpg)$/,
// Output font files
loader: 'file-loader?name=files/[name].[ext]'
}
]
},
// Output bundle of CSS
plugins: [
new ExtractTextPlugin("[name].css")
]
};