mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
feat(webpack): try resolving compiler, but don't fail if not found
This commit is contained in:

committed by
Nathan Walker

parent
9ce48f42fd
commit
97dda95024
@ -32,7 +32,7 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
|
||||
.tap((options) => {
|
||||
return {
|
||||
...options,
|
||||
compiler: require('nativescript-vue-template-compiler'),
|
||||
compiler: getTemplateCompiler(),
|
||||
};
|
||||
});
|
||||
|
||||
@ -117,3 +117,11 @@ function patchVueLoaderForHMR() {
|
||||
error('Failed to patch VueLoader - HMR may not work properly!');
|
||||
}
|
||||
}
|
||||
|
||||
function getTemplateCompiler() {
|
||||
try {
|
||||
return require('nativescript-vue-template-compiler');
|
||||
} catch (err) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user