diff --git a/compiler/main.js b/compiler/main.js index 8a3415f..a550403 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -60,6 +60,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 c88ec47..dfacc87 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -123,7 +123,8 @@ function initConfig(config) { }); if (!/ets_loader_ark$/.test(__dirname)) { config.cache = { - type: "filesystem" + type: "filesystem", + cacheDirectory: path.resolve(projectConfig.cachePath, '.ets_cache') }; } } @@ -148,6 +149,9 @@ function setProjectConfig(envArgs) { if (envArgs.aceModuleJsonPath) { projectConfig.aceModuleJsonPath = envArgs.aceModuleJsonPath; } + if (envArgs.cachePath) { + projectConfig.cachePath = envArgs.cachePath; + } } function setReleaseConfig(config) {