Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
fix(babel): fix babel preset options caching
Browse files Browse the repository at this point in the history
Babel preset options were cached mistakenly between server and client
compiles.

Fixes ream/ream#140
  • Loading branch information
IlyaSemenov committed May 10, 2019
1 parent cb95cc3 commit 5695b14
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/webpack/loaders/ream-babel-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const logger = require('../../logger')

module.exports = babelLoader.custom(babel => {
const configs = new Set()
let reamPresetItem

return {
customOptions(opts) {
Expand All @@ -24,14 +23,12 @@ module.exports = babelLoader.custom(babel => {
}
}

reamPresetItem =
reamPresetItem ||
babel.createConfigItem(
[require.resolve('../../babel/preset'), customOptions],
{
type: 'preset'
}
)
const reamPresetItem = babel.createConfigItem(
[require.resolve('../../babel/preset'), customOptions],
{
type: 'preset'
}
)

// Add our default preset
options.presets = [reamPresetItem, ...options.presets]
Expand Down

0 comments on commit 5695b14

Please sign in to comment.