-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec.config.js
140 lines (137 loc) · 6.03 KB
/
spec.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
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
const path = require("path");
const webpack = require("webpack");
const CopyPlugin = require("copy-webpack-plugin");
const CleanupPlugin = require("webpack-cleanup-plugin");
const nodeExternals = require("webpack-node-externals");
const DefinePlugin = webpack.DefinePlugin;
var specNodeConfig = {
target: "node",
entry: [
path.resolve(__dirname, "./spec/infrastructure/logging/index.js"),
path.resolve(__dirname, "./spec/infrastructure/util/index.js"),
path.resolve(__dirname, "./spec/infrastructure/events/index.node.js"),
path.resolve(__dirname, "./spec/infrastructure/repositories/index.js"),
path.resolve(__dirname, "./spec/infrastructure/cryptography/index.node.js"),
path.resolve(__dirname, "./spec/infrastructure/text-search/index.js"),
path.resolve(__dirname, "./spec/infrastructure/dependency-injection/index.js"),
path.resolve(__dirname, "./spec/outlines/model/index.js"),
path.resolve(__dirname, "./spec/outlines/repositories/index.node.js")
],
output: {
path: path.resolve(__dirname, "./dist/spec/node"),
filename: "d8s-infrastructure.spec.js"
},
externals: [ nodeExternals() ],
resolve: {
extensions: [ ".node.js", ".js" ],
alias: {
"d8s/infrastructure/logging$": path.resolve(__dirname, "./src/infrastructure/logging/index.js"),
"d8s/infrastructure/util$": path.resolve(__dirname, "./src/infrastructure/util/index.node.js"),
"d8s/infrastructure/model$": path.resolve(__dirname, "./src/infrastructure/model/index.js"),
"d8s/infrastructure/repositories$": path.resolve(__dirname, "./src/infrastructure/repositories/index.js"),
"d8s/infrastructure/events$": path.resolve(__dirname, "./src/infrastructure/events/index.node.js"),
"d8s/infrastructure/cryptography$": path.resolve(__dirname, "./src/infrastructure/cryptography/index.node.js"),
"d8s/infrastructure/text-search$": path.resolve(__dirname, "./src/infrastructure/text-search/index.js"),
"d8s/infrastructure/dependency-injection$": path.resolve(__dirname, "./src/infrastructure/dependency-injection/index.js"),
"d8s/outlines/events$": path.resolve(__dirname, "./src/outlines/events/index.js"),
"d8s/outlines/model$": path.resolve(__dirname, "./src/outlines/model/index.js"),
"d8s/outlines/factories$": path.resolve(__dirname, "./src/outlines/factories/index.js"),
"d8s/outlines/repositories$": path.resolve(__dirname, "./src/outlines/repositories/index.js")
}
},
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
use: [
"babel-loader",
"eslint-loader"
]
}]
},
plugins: [
new DefinePlugin({
DEBUG: true
}),
new CleanupPlugin()
],
devtool: "source-map"
};
var specWebConfig = {
target: "web",
entry: [
path.resolve(__dirname, "./spec/infrastructure/logging/index.js"),
path.resolve(__dirname, "./spec/infrastructure/util/index.js"),
path.resolve(__dirname, "./spec/infrastructure/data/index.web.js"),
path.resolve(__dirname, "./spec/infrastructure/events/index.web.js"),
path.resolve(__dirname, "./spec/infrastructure/repositories/index.js"),
path.resolve(__dirname, "./spec/infrastructure/cryptography/index.web.js"),
path.resolve(__dirname, "./spec/infrastructure/text-search/index.js"),
path.resolve(__dirname, "./spec/infrastructure/dependency-injection/index.js"),
path.resolve(__dirname, "./spec/outlines/model/index.js"),
path.resolve(__dirname, "./spec/outlines/repositories/index.web.js")
],
output: {
path: path.resolve(__dirname, "./dist/spec/web"),
filename: "d8s-infrastructure.spec.js"
},
externals: {
"chai": "chai",
"sinon": "sinon"
},
resolve: {
extensions: [ ".web.js", ".js" ],
alias: {
"d8s/infrastructure/logging$": path.resolve(__dirname, "./src/infrastructure/logging/index.js"),
"d8s/infrastructure/util$": path.resolve(__dirname, "./src/infrastructure/util/index.web.js"),
"d8s/infrastructure/data$": path.resolve(__dirname, "./src/infrastructure/data/index.web.js"),
"d8s/infrastructure/model$": path.resolve(__dirname, "./src/infrastructure/model/index.js"),
"d8s/infrastructure/repositories$": path.resolve(__dirname, "./src/infrastructure/repositories/index.js"),
"d8s/infrastructure/events$": path.resolve(__dirname, "./src/infrastructure/events/index.web.js"),
"d8s/infrastructure/cryptography$": path.resolve(__dirname, "./src/infrastructure/cryptography/index.web.js"),
"d8s/infrastructure/text-search$": path.resolve(__dirname, "./src/infrastructure/text-search/index.js"),
"d8s/infrastructure/dependency-injection$": path.resolve(__dirname, "./src/infrastructure/dependency-injection/index.js"),
"d8s/outlines/events$": path.resolve(__dirname, "./src/outlines/events/index.js"),
"d8s/outlines/model$": path.resolve(__dirname, "./src/outlines/model/index.js"),
"d8s/outlines/factories$": path.resolve(__dirname, "./src/outlines/factories/index.js"),
"d8s/outlines/repositories$": path.resolve(__dirname, "./src/outlines/repositories/index.js")
}
},
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
use: [
"babel-loader",
"eslint-loader"
]
}]
},
plugins: [
new DefinePlugin({
DEBUG: true
}),
new CleanupPlugin(),
new CopyPlugin([{
from: path.resolve(__dirname, "./node_modules/mocha/mocha.css"),
to: path.resolve(__dirname, "./dist/spec/web/css")
}, {
from: path.resolve(__dirname, "./node_modules/mocha/mocha.js"),
to: path.resolve(__dirname, "./dist/spec/web/js")
}, {
from: path.resolve(__dirname, "./node_modules/chai/chai.js"),
to: path.resolve(__dirname, "./dist/spec/web/js")
}, {
from: path.resolve(__dirname, "./node_modules/sinon/pkg/sinon.js"),
to: path.resolve(__dirname, "./dist/spec/web/js")
}, {
from: path.resolve(__dirname, "./spec/spec-runner.html"),
to: path.resolve(__dirname, "./dist/spec/web")
}])
],
devtool: "source-map"
};
module.exports = [
specNodeConfig,
specWebConfig
];