diff --git a/compiler/main.js b/compiler/main.js index 8b7fbca..388176c 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -59,6 +59,8 @@ function initProjectConfig(projectConfig) { projectConfig.hashProjectPath = projectConfig.hashProjectPath || hashProjectPath(projectConfig.projectPath) projectConfig.aceBuildJson = projectConfig.aceBuildJson || process.env.aceBuildJson; + projectConfig.cachePath = projectConfig.cachePath || process.env.cachePath || + path.resolve(__dirname, 'node_modules/.cache'); } function loadEntryObj(projectConfig) { diff --git a/compiler/webpack.config.js b/compiler/webpack.config.js index d0e772f..c4957cd 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -117,7 +117,8 @@ function initConfig(config) { }); if (!/ets_loader_ark$/.test(__dirname)) { config.cache = { - type: "filesystem" + type: "filesystem", + cacheDirectory: path.resolve(projectConfig.cachePath, '.ets_cache') }; } } @@ -142,6 +143,9 @@ function setProjectConfig(envArgs) { if (envArgs.aceModuleJsonPath) { projectConfig.aceModuleJsonPath = envArgs.aceModuleJsonPath; } + if (envArgs.cachePath) { + projectConfig.cachePath = envArgs.cachePath; + } } function setReleaseConfig(config) {