-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
82 lines (77 loc) · 2.31 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
import path from 'path';
import ResolveTypeScriptPlugin from "resolve-typescript-plugin";
import { dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
const sharedConfig = {
mode: 'development',
resolve: {
preferRelative: true,
extensions: [".js", ".ts"],
plugins: [
new ResolveTypeScriptPlugin.default({
includeNodeModules: true
})
],
},
module: {
rules: [
{
test: /(\.ts|\.js)$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
compilerOptions: {
module: "ES2020"
}
}
},
],
},
],
},
}
const devConfig = {
name: 'devserver',
...sharedConfig,
devServer: {
hot: false,
static: [
path.resolve(process.cwd(), 'public'),
path.resolve(process.cwd(), 'node_modules/qunitx/vendor'),
],
onBeforeSetupMiddleware: function (app, server) {
import("@memoria/server/test/helpers/webserver-for-passthrough.js");
},
devMiddleware: {
writeToDisk: true
},
port: 1234
},
entry: {
// 'examples/basic': './examples/basic/index.ts',
// 'examples/blog': path.resolve(__dirname, './examples/blog/index.ts'),
'test/index': path.resolve(__dirname, './test/index.ts')
},
// resolve: {
// alias: {
// '@memoria/model/test': path.resolve(__dirname, 'packages/@memoria/model/test/index'),
// '@memserver/model': path.resolve(__dirname, 'packages/@memserver/model/src/index.ts'),
// '@memoria/response/test': path.resolve(__dirname, 'packages/@memoria/response/test/index'),
// '@memserver/response': path.resolve(__dirname, 'packages/@memserver/response/src/index.ts'),
// '@memoria/server/test': path.resolve(__dirname, 'packages/@memoria/server/test/index'),
// '@memserver/server': path.resolve(__dirname, 'packages/@memserver/server/src/index.ts')
// }
// },
// externals: {
// // Remove once we have new glimmer-vm version published. The duplicate version is from linking issues
// '@glimmer/validator': 'commonjs @glimmer/validator'
// },
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'),
},
}
export default [devConfig];