mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
fix(webpack): don't require ts transformer unless processing ts file
This commit is contained in:
@ -57,7 +57,7 @@
|
|||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"pre-commit": "lint-staged"
|
"pre-commit": "npx lint-staged"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
|
@ -5,7 +5,6 @@ const webpack = require("webpack");
|
|||||||
const nsWebpack = require("@nativescript/webpack");
|
const nsWebpack = require("@nativescript/webpack");
|
||||||
const nativescriptTarget = require("@nativescript/webpack/nativescript-target");
|
const nativescriptTarget = require("@nativescript/webpack/nativescript-target");
|
||||||
const { getNoEmitOnErrorFromTSConfig } = require("@nativescript/webpack/utils/tsconfig-utils");
|
const { getNoEmitOnErrorFromTSConfig } = require("@nativescript/webpack/utils/tsconfig-utils");
|
||||||
const nsTransformNativeClasses = require("@nativescript/webpack/transformers/ns-transform-native-classes").default;
|
|
||||||
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
||||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
||||||
@ -250,7 +249,9 @@ module.exports = env => {
|
|||||||
declaration: false
|
declaration: false
|
||||||
},
|
},
|
||||||
getCustomTransformers: (program) => ({
|
getCustomTransformers: (program) => ({
|
||||||
before: [nsTransformNativeClasses]
|
before: [
|
||||||
|
require("@nativescript/webpack/transformers/ns-transform-native-classes").default
|
||||||
|
]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ const NsVueTemplateCompiler = require("nativescript-vue-template-compiler");
|
|||||||
|
|
||||||
const nsWebpack = require("@nativescript/webpack");
|
const nsWebpack = require("@nativescript/webpack");
|
||||||
const nativescriptTarget = require("@nativescript/webpack/nativescript-target");
|
const nativescriptTarget = require("@nativescript/webpack/nativescript-target");
|
||||||
const nsTransformNativeClasses = require("@nativescript/webpack/transformers/ns-transform-native-classes").default;
|
|
||||||
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
|
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
|
||||||
const hashSalt = Date.now().toString();
|
const hashSalt = Date.now().toString();
|
||||||
|
|
||||||
@ -268,7 +267,9 @@ module.exports = env => {
|
|||||||
declaration: false
|
declaration: false
|
||||||
},
|
},
|
||||||
getCustomTransformers: (program) => ({
|
getCustomTransformers: (program) => ({
|
||||||
before: [nsTransformNativeClasses]
|
before: [
|
||||||
|
require("@nativescript/webpack/transformers/ns-transform-native-classes").default
|
||||||
|
]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user