-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
43 lines (39 loc) · 978 Bytes
/
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
const path = require('path')
const {
createConfigBase,
createDevServerConfig,
loaders,
dist,
} = require('./webpack.common.js')
function createConfig(module) {
return createConfigBase(dist, {
name: module,
entry: {
[`${module}_js`]: ['./src/polyfill.js', `./src/${module}/app.tsx`],
[`${module}_css`]: `./src/${module}/main.scss`,
},
module: {
rules: [
loaders.source,
loaders.js(module),
loaders.ts(module),
loaders.css,
loaders.elm(module),
loaders.file,
loaders.url,
],
},
devServer: createDevServerConfig(path.join(__dirname, '../backend/public')),
})
}
const siteConfig = createConfigBase(dist, {
name: 'site',
entry: {
site_js: './src/site/app.js',
site_css: './src/site/main.scss',
},
module: {
rules: [loaders.js(), loaders.css, loaders.file],
},
})
module.exports = [siteConfig, createConfig('garage'), createConfig('battle')]