fix(web): use require.resolve for babel presets/plugins so we don't rely on module hoisting (#1813)
This commit is contained in:
parent
835f3b091d
commit
6f48e0175d
@ -50,7 +50,7 @@ export function getBaseWebpackPartial(
|
|||||||
compact: isScriptOptimizeOn,
|
compact: isScriptOptimizeOn,
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
'@babel/preset-env',
|
require.resolve('@babel/preset-env'),
|
||||||
{
|
{
|
||||||
// Allows browserlist file from project to be used.
|
// Allows browserlist file from project to be used.
|
||||||
configPath: dirname(options.main),
|
configPath: dirname(options.main),
|
||||||
@ -67,16 +67,16 @@ export function getBaseWebpackPartial(
|
|||||||
targets: esm ? { esmodules: true } : undefined
|
targets: esm ? { esmodules: true } : undefined
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
['@babel/preset-typescript']
|
[require.resolve('@babel/preset-typescript')]
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
'babel-plugin-macros',
|
require.resolve('babel-plugin-macros'),
|
||||||
[
|
[
|
||||||
// Allows decorators to be before export since it is consistent with TypeScript syntax.
|
// Allows decorators to be before export since it is consistent with TypeScript syntax.
|
||||||
'@babel/plugin-proposal-decorators',
|
require.resolve('@babel/plugin-proposal-decorators'),
|
||||||
{ decoratorsBeforeExport: true }
|
{ decoratorsBeforeExport: true }
|
||||||
],
|
],
|
||||||
['@babel/plugin-proposal-class-properties']
|
[require.resolve('@babel/plugin-proposal-class-properties')]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user