Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vue/compiler-sfc

Package Overview
Dependencies
Maintainers
1
Versions
276
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/compiler-sfc - npm Package Compare versions

Comparing version 3.0.0-beta.4 to 3.0.0-beta.5

dist/compiler-sfc.esm-browser.js

36

dist/compiler-sfc.cjs.js

@@ -8,7 +8,7 @@ 'use strict';

var sourceMap = require('source-map');
var LRUCache = _interopDefault(require('lru-cache'));
var shared = require('@vue/shared');
var CompilerDOM = require('@vue/compiler-dom');
var compilerCore = require('@vue/compiler-core');
var url = require('url');
var consolidate = _interopDefault(require('consolidate'));
var CompilerSSR = require('@vue/compiler-ssr');
var postcss = _interopDefault(require('postcss'));

@@ -19,4 +19,4 @@ var selectorParser = _interopDefault(require('postcss-selector-parser'));

const SFC_CACHE_MAX_SIZE = 500;
const sourceToSFC = new LRUCache(SFC_CACHE_MAX_SIZE);
function parse(source, { sourceMap = true, filename = 'component.vue', sourceRoot = '', pad = false, compiler = require('@vue/compiler-dom') } = {}) {
const sourceToSFC = new (require('lru-cache'))(SFC_CACHE_MAX_SIZE);
function parse(source, { sourceMap = true, filename = 'component.vue', sourceRoot = '', pad = false, compiler = CompilerDOM } = {}) {
const sourceKey = source + sourceMap + filename + sourceRoot + pad + compiler.parse;

@@ -380,4 +380,8 @@ const cache = sourceToSFC.get(sourceKey);

function compileTemplate(options) {
const { preprocessLang } = options;
const preprocessor = preprocessLang && consolidate[preprocessLang];
const { preprocessLang, preprocessCustomRequire } = options;
const preprocessor = preprocessLang
? preprocessCustomRequire
? preprocessCustomRequire(preprocessLang)
: require('consolidate')[preprocessLang]
: false;
if (preprocessor) {

@@ -415,3 +419,3 @@ try {

}
function doCompileTemplate({ filename, inMap, source, ssr = false, compiler = ssr ? require('@vue/compiler-ssr') : require('@vue/compiler-dom'), compilerOptions = {}, transformAssetUrls }) {
function doCompileTemplate({ filename, inMap, source, ssr = false, compiler = ssr ? CompilerSSR : CompilerDOM, compilerOptions = {}, transformAssetUrls }) {
const errors = [];

@@ -787,13 +791,11 @@ let nodeTransforms = [];

if (modules) {
if (options.isAsync) {
plugins.push(require('postcss-modules')({
...modulesOptions,
getJSON: (cssFileName, json) => {
cssModules = json;
}
}));
if (!options.isAsync) {
throw new Error('[@vue/compiler-sfc] `modules` option can only be used with compileStyleAsync().');
}
else {
throw new Error('`modules` option can only be used with compileStyleAsync().');
}
plugins.push(require('postcss-modules')({
...modulesOptions,
getJSON: (_cssFileName, json) => {
cssModules = json;
}
}));
}

@@ -800,0 +802,0 @@ const postCSSOptions = {

@@ -29,3 +29,3 @@ import { CodegenResult } from '@vue/compiler-core';

declare interface SFCAsyncStyleCompileOptions extends SFCStyleCompileOptions {
export declare interface SFCAsyncStyleCompileOptions extends SFCStyleCompileOptions {
isAsync?: boolean;

@@ -119,2 +119,3 @@ modules?: boolean;

preprocessOptions?: any;
preprocessCustomRequire?: (id: string) => any;
transformAssetUrls?: AssetURLOptions | boolean;

@@ -121,0 +122,0 @@ }

{
"name": "@vue/compiler-sfc",
"version": "3.0.0-beta.4",
"version": "3.0.0-beta.5",
"description": "@vue/compiler-sfc",

@@ -11,6 +11,10 @@ "main": "dist/compiler-sfc.cjs.js",

"buildOptions": {
"name": "VueCompilerSFC",
"formats": [
"cjs",
"global",
"esm-browser"
],
"prod": false,
"formats": [
"cjs"
]
"enableNonBrowserBranches": true
},

@@ -31,9 +35,9 @@ "repository": {

"peerDependencies": {
"vue": "3.0.0-beta.4"
"vue": "3.0.0-beta.5"
},
"dependencies": {
"@vue/compiler-core": "3.0.0-beta.4",
"@vue/compiler-dom": "3.0.0-beta.4",
"@vue/compiler-ssr": "3.0.0-beta.4",
"@vue/shared": "3.0.0-beta.4",
"@vue/compiler-core": "3.0.0-beta.5",
"@vue/compiler-dom": "3.0.0-beta.5",
"@vue/compiler-ssr": "3.0.0-beta.5",
"@vue/shared": "3.0.0-beta.5",
"consolidate": "^0.15.1",

@@ -40,0 +44,0 @@ "hash-sum": "^2.0.0",

@@ -9,4 +9,8 @@ # @vue/compiler-sfc

## Browser Build Usage
This package relies on `postcss`, `postcss-selector-parser` and `postcss-modules`
## API
TODO
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc