1 | 'use strict'
|
2 |
|
3 | const paths = require('./paths')
|
4 | const getEnv = require('./env')
|
5 | const { ensureSlash, camelName } = require('../libs/utils')
|
6 | const defConf = require('./default')
|
7 | const maraConf = require(paths.marauder)
|
8 | const pkgName = require(paths.packageJson).name
|
9 | const maraVersion = require(paths.ownPackageJson).version
|
10 |
|
11 | function getServedPath(publicUrl) {
|
12 |
|
13 | return publicUrl ? ensureSlash(publicUrl, true) : '/'
|
14 | }
|
15 |
|
16 | const publicPath = getServedPath(maraConf.publicPath)
|
17 | const publicDevPath = getServedPath(maraConf.publicDevPath)
|
18 |
|
19 | module.exports = {
|
20 |
|
21 |
|
22 | hash: {
|
23 | main: true,
|
24 | chunk: true,
|
25 | assets: true
|
26 | },
|
27 | version: maraVersion,
|
28 | debug: maraConf.debug,
|
29 | library: {
|
30 | root: 'MyLibrary',
|
31 | amd: pkgName,
|
32 | commonjs: pkgName
|
33 | },
|
34 | assetsDir: 'static',
|
35 |
|
36 | compiler: Object.assign({}, defConf.compiler, maraConf.compiler),
|
37 | entry: defConf.esm.entry,
|
38 |
|
39 | esm: defConf.esm,
|
40 |
|
41 | vendor: [],
|
42 | paths: paths,
|
43 | build: {
|
44 | env: getEnv(publicPath.slice(0, -1)),
|
45 | assetsPublicPath: publicPath,
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | bundleAnalyzerReport: process.env.npm_config_report,
|
51 |
|
52 |
|
53 |
|
54 | uploadFtp: process.env.npm_config_ftp,
|
55 | testDeploy: process.env.npm_config_test
|
56 | },
|
57 | dev: {
|
58 | env: getEnv(publicDevPath.slice(0, -1)),
|
59 | port: defConf.dev.port,
|
60 | assetsPublicPath: publicDevPath,
|
61 | proxyTable: {},
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 | cssSourceMap: false
|
68 | },
|
69 | ftp: Object.assign({}, defConf.ftp, maraConf.ftp),
|
70 | ciConfig: Object.assign({}, defConf.ciConfig, maraConf.ciConfig),
|
71 |
|
72 | hybrid: defConf.hybrid,
|
73 | postcss: defConf.postcss
|
74 | }
|