diff --git a/compiler/main.js b/compiler/main.js index 6a6d42c..c6287be 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -56,6 +56,8 @@ function initProjectConfig(projectConfig) { projectConfig.aceSuperVisualPath = projectConfig.aceSuperVisualPath || process.env.aceSuperVisualPath 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 12360d7..7472624 100644 --- a/compiler/webpack.config.js +++ b/compiler/webpack.config.js @@ -39,9 +39,6 @@ function initConfig(config) { const projectPath = path.resolve(projectConfig.projectPath); Object.assign(config, { entry: projectConfig.entryObj, - cache: { - type: "filesystem" - }, watch: watchMode, watchOptions: { aggregateTimeout: 10, @@ -116,6 +113,12 @@ function initConfig(config) { new ResultStates() ] }); + if (!/ets_loader_ark$/.test(__dirname)) { + config.cache = { + type: "filesystem", + cacheDirectory: path.resolve(projectConfig.cachePath, '.ets_cache') + }; + } } function setProjectConfig(envArgs) { @@ -138,6 +141,9 @@ function setProjectConfig(envArgs) { if (envArgs.aceModuleJsonPath) { projectConfig.aceModuleJsonPath = envArgs.aceModuleJsonPath; } + if (envArgs.cachePath) { + projectConfig.cachePath = envArgs.cachePath; + } } function setReleaseConfig(config) {