Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Commit c073af1

Browse files
ArgonAlexs-panferov
authored andcommitted
fix: environment cache invalidation (#449)
fix: environment cache invalidation
1 parent f14eaab commit c073af1

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/instance.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export function ensureInstance(
119119

120120
let babelImpl = setupBabel(loaderConfig, context);
121121
let cacheIdentifier = setupCache(
122+
compilerConfig,
122123
loaderConfig,
123124
tsImpl,
124125
webpack,
@@ -190,13 +191,13 @@ export function setupTs(compiler: string): CompilerInfo {
190191
}
191192

192193
function setupCache(
194+
compilerConfig: TsConfig,
193195
loaderConfig: LoaderConfig,
194196
tsImpl: typeof ts,
195197
webpack: Loader,
196198
babelImpl: any,
197199
context: string
198200
) {
199-
let cacheIdentifier = null;
200201
if (loaderConfig.useCache) {
201202
if (!loaderConfig.cacheDirectory) {
202203
loaderConfig.cacheDirectory = path.join(context, '.awcache');
@@ -206,13 +207,14 @@ function setupCache(
206207
mkdirp.sync(loaderConfig.cacheDirectory);
207208
}
208209

209-
cacheIdentifier = {
210-
'typescript': tsImpl.version,
210+
return {
211+
typescript: tsImpl.version,
211212
'awesome-typescript-loader': pkg.version,
212-
'awesome-typescript-loader-query': webpack.query,
213-
'babel-core': babelImpl
214-
? babelImpl.version
215-
: null
213+
'babel-core': babelImpl ? babelImpl.version : null,
214+
babelPkg: pkg.babel,
215+
// TODO: babelrc.json/babelrc.js
216+
compilerConfig,
217+
env: process.env.BABEL_ENV || process.env.NODE_ENV || 'development'
216218
};
217219
}
218220
}

0 commit comments

Comments
 (0)