Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@vue/component-compiler
Advanced tools
High level utilities for compiling Vue single file components
This package contains hid level utilities that you can use if you are writing a plugin / transform for a bundler or module system that compiles Vue single file components into JavaScript. It is used in rollup-plugin-vue version 3 and above.
The API surface is intentionally minimal - the goal is to reuse as much as possible while being as flexible as possible.
Creates a compiler instance.
interface Options {
script?: ScriptOptions
style?: StyleOptions
template?: TemplateOptions
}
interface ScriptOptions {
preprocessorOptions?: any
}
interface StyleOptions {
postcssOptions?: any
postcssPlugins?: any[]
postcssModulesOptions?: any
preprocessOptions?: any
postcssCleanOptions?: any
trim?: boolean
}
interface TemplateOptions {
compiler: VueTemplateCompiler
compilerOptions: VueTemplateCompilerOptions
preprocessOptions?: any
transformAssetUrls?: AssetURLOptions | boolean
transpileOptions?: any
isProduction?: boolean
optimizeSSR?: boolean
}
Takes raw source and compiles each block separately. Internally, it uses compileTemplate and compileStyle from @vue/component-compiler-utils.
interface DescriptorCompileResult {
customBlocks: SFCBlock[]
scopeId: string
script?: CompileResult
styles: StyleCompileResult[]
template?: TemplateCompileResult & { functional: boolean }
}
interface CompileResult {
code: string
map?: any
}
interface StyleCompileResult {
code: string
map?: any
scoped?: boolean
media?: string
moduleName?: string
module?: any
}
interface TemplateCompileResult {
code: string;
source: string;
tips: string[];
errors: string[];
functional: boolean;
}
The blocks from the resulting descriptor should be assembled into JavaScript code:
interface AssembleResults {
code: string
map?: any
}
interface AssembleOptions {
normalizer?: string
styleInjector?: string
styleInjectorSSR?: string
}
The assemble
method is an example implementation for how to combine various parts from the descriptor. You can provide custom implementations for normalizer
, styleInjector
and styleInjectorSSR
:
The assemble
method also accepts global variable name in source
, map
and module
of styles.
3.4.4 (2018-07-31)
<a name="3.4.3"></a>
FAQs
bundler agnostic API for compiling Vue SFC
The npm package @vue/component-compiler receives a total of 24,604 weekly downloads. As such, @vue/component-compiler popularity was classified as popular.
We found that @vue/component-compiler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 19 open source maintainers 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.