Skip to content

Commit 01ad066

Browse files
committed
Pass PROJECT_DIR option to webpack config
1 parent a5fc1f9 commit 01ad066

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ng-sample/hooks/after-prepare/webpack.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var shelljs = require("shelljs");
44
module.exports = function (logger, platformsData, projectData, hookArgs) {
55
var platformData = platformsData.getPlatformData(hookArgs.platform.toLowerCase());
66
var outDir = platformData.appDestinationDirectoryPath;
7+
process.env.PROJECT_DIR = outDir;
78

89
var gradleScript = path.join(outDir, "../../../", "build.gradle");
910
shelljs.sed("-i", /aaptOptions.*\{[^\}]+\}/, "", gradleScript);

ng-sample/webpack.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ var path = require("path");
22
var webpack = require("webpack");
33

44

5+
console.log('PROJECT_DIR: ' + process.env.PROJECT_DIR);
6+
57
module.exports = {
6-
context: "./platforms/android/src/main/assets/app",
8+
//context: "./platforms/android/src/main/assets/app",
9+
context: process.env.PROJECT_DIR,
710
entry: {
811
app: "./app",
912
},
@@ -38,5 +41,10 @@ module.exports = {
3841
global: 'global',
3942
__dirname: '__dirname'
4043
}),
44+
new webpack.optimize.UglifyJsPlugin({
45+
compress: {
46+
warnings: true
47+
}
48+
})
4149
]
4250
};

0 commit comments

Comments
 (0)