mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 01:43:14 +08:00
feat: support importHelpers config option
This commit is contained in:
3
packages/core/tslib/index.ts
Normal file
3
packages/core/tslib/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export * from 'tslib?original';
|
||||
import { __extends as tslibExtends } from 'tslib?original';
|
||||
export const __extends = global.__extends || tslibExtends;
|
3
packages/core/tslib/references.d.ts
vendored
Normal file
3
packages/core/tslib/references.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
declare module 'tslib?original' {
|
||||
export * from 'tslib';
|
||||
}
|
@ -1,8 +1,9 @@
|
||||
import { extname, resolve } from 'path';
|
||||
import { extname, resolve, join } from 'path';
|
||||
import {
|
||||
ContextExclusionPlugin,
|
||||
DefinePlugin,
|
||||
HotModuleReplacementPlugin,
|
||||
NormalModuleReplacementPlugin,
|
||||
} from 'webpack';
|
||||
import Config from 'webpack-chain';
|
||||
import { existsSync } from 'fs';
|
||||
@ -368,6 +369,13 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
|
||||
// }
|
||||
// ])
|
||||
|
||||
config
|
||||
.plugin('NormalModuleReplacementPlugin|tslib')
|
||||
.use(NormalModuleReplacementPlugin, [
|
||||
/^tslib$/,
|
||||
'@nativescript/core/tslib',
|
||||
]);
|
||||
|
||||
config.plugin('PlatformSuffixPlugin').use(PlatformSuffixPlugin, [
|
||||
{
|
||||
platform,
|
||||
|
Reference in New Issue
Block a user