Socket
Socket
Sign inDemoInstall

rollup-plugin-vue

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-vue - npm Package Compare versions

Comparing version 5.1.5 to 5.1.6

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="5.1.6"></a>
## [5.1.6](https://github.com/vuejs/rollup-plugin-vue/compare/v5.1.5...v5.1.6) (2020-01-22)
### Bug Fixes
* **tsconfig.json:** transpile async await in order to be compatible to rollup-plugin-typescript2 ([#324](https://github.com/vuejs/rollup-plugin-vue/issues/324)) ([deb4a1b](https://github.com/vuejs/rollup-plugin-vue/commit/deb4a1b))
<a name="5.1.5"></a>

@@ -7,0 +17,0 @@ ## [5.1.5](https://github.com/vuejs/rollup-plugin-vue/compare/v5.1.4...v5.1.5) (2020-01-06)

184

dist/rollup-plugin-vue.js

@@ -13,2 +13,26 @@ 'use strict';

/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function __awaiter(thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
const GET_QUERY = /\.vue(\.[a-z]+?)?\?(.+)$/i;

@@ -121,6 +145,3 @@ const PARAM_NAME = 'rollup-plugin-vue';

'~' + 'vue-runtime-helpers/dist/inject-style/shadow.mjs';
createVuePartRequest.defaultLang = {
...createVuePartRequest.defaultLang,
...opts.defaultLang
};
createVuePartRequest.defaultLang = Object.assign({}, createVuePartRequest.defaultLang, opts.defaultLang);
const shouldExtractCss = opts.css === false;

@@ -151,4 +172,3 @@ const customBlocks = [];

delete opts.exclude;
opts.template = {
transformAssetUrls: {
opts.template = Object.assign({ transformAssetUrls: {
video: ['src', 'poster'],

@@ -158,5 +178,3 @@ source: 'src',

image: 'xlink:href'
},
...opts.template
};
} }, opts.template);
if (opts.template && typeof opts.template.isProduction === 'undefined') {

@@ -226,45 +244,46 @@ opts.template.isProduction = isProduction;

},
async transform(source, filename) {
if (isVue(filename)) {
// Create deep copy to prevent issue during watching changes.
const descriptor = JSON.parse(JSON.stringify(componentCompilerUtils.parse({
filename,
source,
compiler: opts.compiler || templateCompiler,
compilerParseOptions: opts.compilerParseOptions,
sourceRoot: opts.sourceRoot,
needMap: 'needMap' in opts ? opts.needMap : true
})));
descriptors.set(filename, descriptor);
const scopeId = 'data-v-' +
(isProduction
? hash(path.basename(filename) + source)
: hash(filename + source));
const styles = await Promise.all(descriptor.styles.map(async (style) => {
if (style.content) {
style.content = prependStyle(filename, style.lang || 'css', style.content, style.map).code;
transform(source, filename) {
return __awaiter(this, void 0, void 0, function* () {
if (isVue(filename)) {
// Create deep copy to prevent issue during watching changes.
const descriptor = JSON.parse(JSON.stringify(componentCompilerUtils.parse({
filename,
source,
compiler: opts.compiler || templateCompiler,
compilerParseOptions: opts.compilerParseOptions,
sourceRoot: opts.sourceRoot,
needMap: 'needMap' in opts ? opts.needMap : true
})));
descriptors.set(filename, descriptor);
const scopeId = 'data-v-' +
(isProduction
? hash(path.basename(filename) + source)
: hash(filename + source));
const styles = yield Promise.all(descriptor.styles.map((style) => __awaiter(this, void 0, void 0, function* () {
if (style.content) {
style.content = prependStyle(filename, style.lang || 'css', style.content, style.map).code;
}
const compiled = yield compiler.compileStyleAsync(filename, scopeId, style);
if (compiled.errors.length > 0)
throw Error(compiled.errors[0]);
return compiled;
})));
const input = {
scopeId,
styles,
customBlocks: []
};
if (descriptor.template) {
input.template = compiler.compileTemplate(filename, descriptor.template);
input.template.code = transformRequireToImport(input.template.code);
if (input.template.errors && input.template.errors.length) {
input.template.errors.map((error) => this.error(error));
}
if (input.template.tips && input.template.tips.length) {
input.template.tips.map((message) => this.warn({ message }));
}
}
const compiled = await compiler.compileStyleAsync(filename, scopeId, style);
if (compiled.errors.length > 0)
throw Error(compiled.errors[0]);
return compiled;
}));
const input = {
scopeId,
styles,
customBlocks: []
};
if (descriptor.template) {
input.template = compiler.compileTemplate(filename, descriptor.template);
input.template.code = transformRequireToImport(input.template.code);
if (input.template.errors && input.template.errors.length) {
input.template.errors.map((error) => this.error(error));
}
if (input.template.tips && input.template.tips.length) {
input.template.tips.map((message) => this.warn({ message }));
}
}
input.script = descriptor.script
? {
code: `
input.script = descriptor.script
? {
code: `
export * from '${createVuePartRequest(filename, descriptor.script.lang || 'js', 'script')}'

@@ -274,39 +293,40 @@ import script from '${createVuePartRequest(filename, descriptor.script.lang || 'js', 'script')}'

${exposeFilename
? `
? `
// For security concerns, we use only base name in production mode. See https://github.com/vuejs/rollup-plugin-vue/issues/258
script.__file = ${isProduction
? JSON.stringify(path.basename(filename))
: JSON.stringify(filename)}`
: ''}
? JSON.stringify(path.basename(filename))
: JSON.stringify(filename)}`
: ''}
`
}
: { code: '' };
if (shouldExtractCss) {
input.styles = input.styles
.map((style, index) => {
descriptor.styles[index].code = style.code;
input.script.code +=
'\n' +
`import '${createVuePartRequest(filename, 'css', 'styles', index)}'`;
if (style.module || descriptor.styles[index].scoped) {
return Object.assign({}, style, { code: '', map: undefined });
}
})
.filter(Boolean);
}
: { code: '' };
if (shouldExtractCss) {
input.styles = input.styles
.map((style, index) => {
descriptor.styles[index].code = style.code;
input.script.code +=
input.script.code = input.script.code.replace(/^\s+/gm, '');
const result = componentCompiler.assemble(compiler, filename, beforeAssemble(input), opts);
descriptor.customBlocks.forEach((block, index) => {
if (!isAllowed(block.type))
return;
result.code +=
'\n' +
`import '${createVuePartRequest(filename, 'css', 'styles', index)}'`;
if (style.module || descriptor.styles[index].scoped) {
return { ...style, code: '', map: undefined };
}
})
.filter(Boolean);
`export * from '${createVuePartRequest(filename, (typeof block.attrs.lang === 'string' && block.attrs.lang) ||
createVuePartRequest.defaultLang[block.type] ||
block.type, 'customBlocks', index)}'`;
});
dT(`id: ${filename}\ncode:\n${result.code}\n\nmap:\n${JSON.stringify(result.map, null, 2)}\n`);
result.map = result.map || { mappings: '' };
return result;
}
input.script.code = input.script.code.replace(/^\s+/gm, '');
const result = componentCompiler.assemble(compiler, filename, beforeAssemble(input), opts);
descriptor.customBlocks.forEach((block, index) => {
if (!isAllowed(block.type))
return;
result.code +=
'\n' +
`export * from '${createVuePartRequest(filename, (typeof block.attrs.lang === 'string' && block.attrs.lang) ||
createVuePartRequest.defaultLang[block.type] ||
block.type, 'customBlocks', index)}'`;
});
dT(`id: ${filename}\ncode:\n${result.code}\n\nmap:\n${JSON.stringify(result.map, null, 2)}\n`);
result.map = result.map || { mappings: '' };
return result;
}
});
}

@@ -313,0 +333,0 @@ };

{
"name": "rollup-plugin-vue",
"version": "5.1.5",
"version": "5.1.6",
"description": "Roll .vue files",

@@ -5,0 +5,0 @@ "author": "Rahul Kadyan <hi@znck.me>",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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