Socket
Socket
Sign inDemoInstall

@rollup/plugin-dynamic-import-vars

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rollup/plugin-dynamic-import-vars - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

LICENSE

12

CHANGELOG.md
# @rollup/plugin-dynamic-import-vars ChangeLog
## v1.1.0
_2020-08-13_
### Features
- feat: add support for dynamic expressions with concat (#495)
### Updates
- chore: update dependencies (26f9b6c)
## v1.0.0

@@ -4,0 +16,0 @@

@@ -32,2 +32,14 @@ import path from 'path';

function callExpressionToGlob(node) {
const { callee } = node;
if (
callee.type === 'MemberExpression' &&
callee.property.type === 'Identifier' &&
callee.property.name === 'concat'
) {
return `${expressionToGlob(callee.object)}${node.arguments.map(expressionToGlob).join('')}`;
}
return '*';
}
function binaryExpressionToGlob(node) {

@@ -45,2 +57,4 @@ if (node.operator !== '+') {

return templateLiteralToGlob(node);
case 'CallExpression':
return callExpressionToGlob(node);
case 'BinaryExpression':

@@ -47,0 +61,0 @@ return binaryExpressionToGlob(node);

@@ -38,2 +38,14 @@ 'use strict';

function callExpressionToGlob(node) {
const { callee } = node;
if (
callee.type === 'MemberExpression' &&
callee.property.type === 'Identifier' &&
callee.property.name === 'concat'
) {
return `${expressionToGlob(callee.object)}${node.arguments.map(expressionToGlob).join('')}`;
}
return '*';
}
function binaryExpressionToGlob(node) {

@@ -51,2 +63,4 @@ if (node.operator !== '+') {

return templateLiteralToGlob(node);
case 'CallExpression':
return callExpressionToGlob(node);
case 'BinaryExpression':

@@ -53,0 +67,0 @@ return binaryExpressionToGlob(node);

16

package.json
{
"name": "@rollup/plugin-dynamic-import-vars",
"version": "1.0.0",
"version": "1.1.0",
"publishConfig": {

@@ -24,3 +24,3 @@ "access": "public"

"lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
"lint:docs": "prettier --single-quote --write README.md",
"lint:docs": "prettier --single-quote --arrow-parens avoid --trailing-comma none --write README.md",
"lint:js": "eslint --fix --cache src test --ext .js",

@@ -54,15 +54,17 @@ "lint:package": "prettier --write package.json --plugin=prettier-plugin-package",

"dependencies": {
"@rollup/pluginutils": "^3.0.9",
"@rollup/pluginutils": "^3.1.0",
"estree-walker": "^2.0.1",
"globby": "^11.0.0",
"globby": "^11.0.1",
"magic-string": "^0.25.7"
},
"devDependencies": {
"acorn": "^7.1.1",
"acorn": "^7.3.1",
"acorn-dynamic-import": "^4.0.0",
"ava": "^2.4.0",
"prettier": "^2.0.5",
"rollup": "^2.7.5"
"rollup": "^2.23.0"
},
"ava": {
"babel": {
"compileEnhancements": false
},
"files": [

@@ -69,0 +71,0 @@ "!**/fixtures/**",

@@ -43,4 +43,4 @@ [npm]: https://img.shields.io/npm/v/@rollup/plugin-dynamic-import-vars

// options
}),
],
})
]
};

@@ -110,2 +110,10 @@ ```

```js
'./locales/'.concat(locale, '.js') -> './locales/*.js'
```
```js
'./'.concat(folder, '/').concat(name, '.js') -> './*/*.js'
```
Code that looks like this:

@@ -112,0 +120,0 @@

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