
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@enhancedjs/vue-template-in-string-loader
Advanced tools
Pre-compile Vue templates in JS template strings at compile time.
It is a webpack loader that pre-compiles Vue templates in JavaScript or TypeScript template strings at compile time. It allows to write single file components in standard JavaScript and TypeScript source files.
const template = vueTemplate`
<div class="MyComponent">
… some Vue template code…
</div>
`
export default defineComponent({
name: "MyComponent",
template,
})
The tag vueTemplate
is optional. It helps the vscode extension enhancedjs.html-in-template-string to add some HTML syntax highlighting.
This webpack loader will replace the template string and its tag vueTemplate
at compile time, so it is unecessary to provide an implementation for runtime. But, in a TypeScript project, a declaration has to be provided:
// global.d.ts
declare function vueTemplate(text: TemplateStringsArray): string;
First, add @enhancedjs/vue-template-in-string-loader
to a Vue application:
npm install @enhancedjs/vue-template-in-string-loader --save-dev
In the vue.config.js
file, add a configureWebpack
section:
configureWebpack: {
module: {
rules: [
{
test: /\.(js|ts)$/,
exclude: /node_modules/,
use: {
loader: "@enhancedjs/vue-template-in-string-loader"
}
}
]
}
},
With VS Code, our recommanded plugin is:
ms-vscode.vscode-typescript-tslint-plugin
)FAQs
Pre-compile Vue templates in JS template strings at compile time.
The npm package @enhancedjs/vue-template-in-string-loader receives a total of 11 weekly downloads. As such, @enhancedjs/vue-template-in-string-loader popularity was classified as not popular.
We found that @enhancedjs/vue-template-in-string-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.