-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoren.config.js
More file actions
43 lines (41 loc) · 1.03 KB
/
Copy pathcoren.config.js
File metadata and controls
43 lines (41 loc) · 1.03 KB
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 getDB = require('./server/dummyApiDB');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const extractCSS = new ExtractTextPlugin({
filename: 'css/[name].css',
allChunks: true
});
module.exports = {
entry: {
index: './src/index.js',
$vendor: ['react', 'react-dom', 'react-router']
},
ssrWebpack: {
plugins: [
extractCSS
],
module: {
rules: [
{
test: /\.css$/,
use: extractCSS.extract(["css-loader?minimize"])
}
]
}
},
assetsHost: (env, absolutePath = '') => {
const rel = path.relative(`${__dirname}/dist/`, absolutePath);
switch (env) {
case 'production':
return `https://s3-ap-northeast-1.amazonaws.com/static.canner.io/coren-example/dist/${rel}`;
case 'development':
case 'pre-production':
return `http://localhost:5556/dist/${rel}`;
default:
return false;
}
},
prepareContext: function() {
return getDB().then(db => ({db}));
}
};