-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
48 lines (41 loc) · 1.55 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
// how to found here:
// https://github.com/Robinyo/big-top/blob/master/config/webpack.config.js
// const chalk = require("chalk");
const fs = require('fs');
const path = require('path');
const useDefaultConfig = require('@ionic/app-scripts/config/webpack.config.js');
const env = process.env.IONIC_ENV;
if (env === 'prod' || env === 'dev') {
useDefaultConfig[env].resolve.alias = {
pages: path.resolve("./src/pages"),
providers: path.resolve("./src/providers"),
components: path.resolve("./src/components"),
app: path.resolve("./src/app"),
models: path.resolve("./src/models"),
misc: path.resolve("./src/misc")
};
} else {
// // Default to dev config
// useDefaultConfig[env] = useDefaultConfig.dev;
// useDefaultConfig[env].resolve.alias = {
// "@app": path.resolve('./src/app/'),
// "@assets": path.resolve('./src/assets/'),
// "@env": path.resolve(environmentPath()),
// "@pages": path.resolve('./src/pages/'),
// "@services": path.resolve('./src/services/'),
// "@tests": path.resolve('./src/'),
// "@theme": path.resolve('./src/theme/')
// };
console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!! no support of other env type !!!!!!!!!!!!!!!!!!!!!!")
}
module.exports = function () {
return useDefaultConfig;
};
// function environmentPath() {
// let filePath = './src/environments/environment' + (env === 'prod' ? '' : '.' + env) + '.ts';
// if (!fs.existsSync(filePath)) {
// console.log(chalk.red('\n' + filePath + ' does not exist!'));
// } else {
// return filePath;
// }
// }