-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.lambda.js
147 lines (122 loc) · 6.09 KB
/
webpack.lambda.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
const mix = require('laravel-mix');
const path = require("path");
const fs = require('fs');
require("laravel-mix-merge-manifest");
// const lambdaRoot = "../../vue";
const lambdaRoot = "./node_modules/@lambda-platform";
const dataform_custom = "./dataform_custom/"
if (!fs.existsSync(dataform_custom)) {
fs.mkdirSync(dataform_custom);
}
mix.webpackConfig({
output: {
chunkFilename: "assets/lambda/js/chunks/[name].js?id=[contenthash]"
},
resolve: {
modules: [
path.resolve(__dirname, './node_modules'),
// path.resolve(`${lambdaRoot}/agent/`, 'node_modules'),
// path.resolve(`${lambdaRoot}/dataform/`, 'node_modules'),
// path.resolve(`${lambdaRoot}/datagrid/`, 'node_modules'),
// path.resolve(`${lambdaRoot}/datasource/`, 'node_modules'),
// path.resolve(`${lambdaRoot}/krud/`, 'node_modules'),
// path.resolve(`${lambdaRoot}/moqup/`, 'node_modules'),
// path.resolve(`${lambdaRoot}/page/`, 'node_modules'),
// path.resolve(`${lambdaRoot}/puzzle/`, 'node_modules'),
// path.resolve(`${lambdaRoot}/template/`, 'node_modules'),
// path.resolve(`${lambdaRoot}/chart/`, 'node_modules'),
// path.resolve(`${lambdaRoot}/notify/`, 'node_modules'),
// path.resolve(`${lambdaRoot}/appAdmin/`, 'node_modules'),
],
alias: {
dataform_custom: path.resolve(__dirname, "resources/assets/dataform_custom"),
vue$: "vue/dist/vue.common.js",
},
extensions: ["*", ".js", ".ts", ".vue", ".json"],
symlinks: false
}
});
mix.options({
processCssUrls: false
}).setPublicPath("public");
mix.styles(
[
// `${lambdaRoot}/template/node_modules/` + "iview/dist/styles/iview.css",
// `${lambdaRoot}/dataform/node_modules/` + "leaflet/dist/leaflet.css",
// `${lambdaRoot}/dataform/node_modules/` + "leaflet-draw/dist/leaflet.draw.css",
// `${lambdaRoot}/dataform/node_modules/`+"leaflet.fullscreen/Control.FullScreen.css",
// `${lambdaRoot}/dataform/node_modules/`+"vue-multiselect/dist/vue-multiselect.min.css",
// `${lambdaRoot}/datagrid/node_modules/`+"ag-grid-community/dist/styles/ag-grid.css",
// `${lambdaRoot}/datagrid/node_modules/`+"ag-grid-community/dist/styles/ag-theme-balham.css",
`./node_modules/` + "iview/dist/styles/iview.css",
`./node_modules/` + "leaflet/dist/leaflet.css",
`./node_modules/` + "leaflet-draw/dist/leaflet.draw.css",
`./node_modules/`+"leaflet.fullscreen/Control.FullScreen.css",
`./node_modules/`+"vue-multiselect/dist/vue-multiselect.min.css",
`./node_modules/`+"ag-grid-community/dist/styles/ag-grid.css",
`./node_modules/`+"ag-grid-community/dist/styles/ag-theme-balham.css",
],
"public/assets/lambda/css/vendor.css"
);
mix.extract(
["ag-grid-community", "ag-grid-enterprise", "ag-grid-vue"],
"public/assets/lambda/js/datagrid-vendor.js"
);
mix.extract(
[
"sql-formatter",
"sql-parser",
"jQuery-QueryBuilder",
"axios",
"iview",
"leaflet",
"esri-leaflet",
"leaflet.fullscreen",
"leaflet-draw",
"leaflet-rotatedmarker",
"leaflet.gridlayer.googlemutant",
"lodash",
"normalize.css",
"vue",
"vuex",
"vue-router"
],
"public/assets/lambda/js/vendor.js"
)
.version()
.mergeManifest();
const compileModules = () => {
mix.js("resources/assets/admin/js/index.js", "public/assets/admin/js/app.js").vue();
mix.sass("resources/assets/admin/scss/style.scss", "public/assets/admin/css/app.css");
mix
.js(`${lambdaRoot}/adminmodule/src/index.js`, `public/assets/lambda/js/adminmodule.js`).vue()
.sass(`${lambdaRoot}/adminmodule/src/scss/style.scss`, `public/assets/lambda/css/adminmodule.css`)
.js(`${lambdaRoot}/agent/src/index.js`, `public/assets/lambda/js/agent.js`).vue()
.sass(`${lambdaRoot}/agent/src/scss/agent.scss`, `public/assets/lambda/css/agent.css`)
.js(`${lambdaRoot}/agent/src/auth.js`, `public/assets/lambda/js/auth.js`).vue()
.sass(`${lambdaRoot}/agent/src/scss/auth.scss`, `public/assets/lambda/css/auth.css`)
.js(`${lambdaRoot}/krud/src/index.js`, "public/assets/lambda/js/krud.js").vue()
.sass(`${lambdaRoot}/krud/src/scss/krud.scss`, `public/assets/lambda/css/krud.css`)
.js(`${lambdaRoot}/datagrid/src/index.js`, `public/assets/lambda/js/datagrid.js`).vue()
.js(`${lambdaRoot}/datagrid/src/index-builder.js`, `public/assets/lambda/js/datagrid-builder.js`).vue()
.sass(`${lambdaRoot}/datagrid/src/scss/style.scss`, `public/assets/lambda/css/datagrid.css`)
.js(`${lambdaRoot}/dataform/src/index.js`, `public/assets/lambda/js/dataform.js`).vue()
.js(`${lambdaRoot}/dataform/src/index-builder.js`, `public/assets/lambda/js/dataform-builder.js`).vue()
.sass(`${lambdaRoot}/dataform/src/scss/style.scss`, `public/assets/lambda/css/dataform.css`)
.js(`${lambdaRoot}/datasource/src/index.js`, `public/assets/lambda/js/datasource.js`).vue()
.sass(`${lambdaRoot}/datasource/src/scss/style.scss`, `public/assets/lambda/css/datasource.css`)
.js(`${lambdaRoot}/page/src/index.js`, "public/assets/lambda/js/page.js").vue()
.js(`${lambdaRoot}/page/src/page-nav.js`, "public/assets/lambda/js/page-nav.js").vue()
.js(`${lambdaRoot}/moqup/src/index.js`, `public/assets/lambda/js/moqup.js`).vue()
.sass(`${lambdaRoot}/moqup/src/scss/style.scss`, `public/assets/lambda/css/moqup.css`)
.js(`${lambdaRoot}/chart/src/index.js`, "public/assets/lambda/js/chart.js").vue()
.sass(`${lambdaRoot}/chart/src/scss/style.scss`, "public/assets/lambda/css/chart.css")
// .sourceMaps()
};
const compileTemplate = () => {
mix.js(`${lambdaRoot}/template/src/paper/index.js`, `public/assets/lambda/js/paper.js`).vue()
.sass(`${lambdaRoot}/template/src/paper/scss/style.scss`, `public/assets/lambda/css/paper.css`);
};
console.log("COMPILING LAMBDA");
compileModules();
compileTemplate();