mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Change env name to LENS_DEV_USE_ESBUILD_LOADER
Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
parent
3fc104c147
commit
282b600229
@ -22,7 +22,7 @@
|
|||||||
/**
|
/**
|
||||||
* A function returning webpack ts/tsx loader
|
* A function returning webpack ts/tsx loader
|
||||||
*
|
*
|
||||||
* depends on env USE_ESBUILD_LOADER to use esbuild-loader (faster) or good-old ts-loader
|
* depends on env LENS_DEV_USE_ESBUILD_LOADER to use esbuild-loader (faster) or good-old ts-loader
|
||||||
*
|
*
|
||||||
* @param testRegExp - the regex for webpack to conditional find the files
|
* @param testRegExp - the regex for webpack to conditional find the files
|
||||||
* @returns ts/tsx webpack loader configuration object
|
* @returns ts/tsx webpack loader configuration object
|
||||||
@ -30,12 +30,13 @@
|
|||||||
const getTsloader = (
|
const getTsloader = (
|
||||||
testRegExp: RegExp, transpileOnly = true
|
testRegExp: RegExp, transpileOnly = true
|
||||||
) => {
|
) => {
|
||||||
const useEsbuildLoader = process.env.USE_ESBUILD_LOADER === "true";
|
const useEsbuildLoader = process.env.LENS_DEV_USE_ESBUILD_LOADER === "true";
|
||||||
|
|
||||||
|
useEsbuildLoader && console.info(`\n🚀 using esbuild-loader for ts(x)`);
|
||||||
|
|
||||||
if (useEsbuildLoader) {
|
if (useEsbuildLoader) {
|
||||||
return {
|
return {
|
||||||
test: testRegExp,
|
test: testRegExp,
|
||||||
exclude: /node_modules/,
|
|
||||||
loader: "esbuild-loader",
|
loader: "esbuild-loader",
|
||||||
options: {
|
options: {
|
||||||
loader: "tsx",
|
loader: "tsx",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user