-
Notifications
You must be signed in to change notification settings - Fork 0
/
poi.config.js
54 lines (46 loc) · 1.42 KB
/
poi.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
// for POI v.10 (webpack 4):
const DEVELOPMENT_PORT = 8080;
module.exports = options => {
console.log({options});
const is_development = options.mode === "development";
console.log({is_development});
// overrides to dist and homepage:
let {outDir, publicPath} = options;
const has_entry_file = (filename) =>
options.entry && options.entry[0] && (options.entry[0].indexOf(filename) > -1)
if (has_entry_file("x")) {
outDir = "dist/x";
publicPath = "/x/";
} // etc.
/////////////////// CONFIGURATION //////////////////////////
return {
outDir,
publicPath,
restartOnFileChanges: false,
vue: {
fullBuild: true // replaces templateCompiler: true,
},
port: DEVELOPMENT_PORT,
html: {
title: "poi-ts-vue-jest-example",
// favicon: "./src/assets/images/favicon.ico" // TODO: consider favicons-webpack-plugin
},
plugins: [
require('@poi/plugin-typescript')(/* options */),
//require('@poi/plugin-bundle-report')(),
//require('@poi/plugin-webpackmonitor')()
],
define: {
IS_PRODUCTION: options.mode === "production",
BUILD_TIMESTAMP: JSON.stringify(new Date().toLocaleString())
},
sourceMap: is_development ?
// DEVELOPMENT:
"source-map" // for vscode chrome debugging
//'cheap-module-eval-source-map'
//'#eval-source-map'
// PRODUCTION:
// : "nosources-source-map";
: "source-map"
}
};