@lwc/rollup-plugin
Advanced tools
Comparing version 0.33.27-alpha2 to 0.33.28-alpha1
{ | ||
"name": "@lwc/rollup-plugin", | ||
"version": "0.33.27-alpha2", | ||
"version": "0.33.28-alpha1", | ||
"description": "Rollup plugin to compile LWC", | ||
@@ -11,7 +11,7 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"@lwc/compiler": "0.33.27-alpha2", | ||
"@lwc/engine": "0.33.27-alpha2" | ||
"@lwc/compiler": "0.33.28-alpha1", | ||
"@lwc/engine": "0.33.28-alpha1" | ||
}, | ||
"dependencies": { | ||
"@lwc/module-resolver": "0.33.27-alpha2", | ||
"@lwc/module-resolver": "0.33.28-alpha1", | ||
"glob": "^7.1.2", | ||
@@ -27,3 +27,3 @@ "rollup-pluginutils": "^2.0.1" | ||
}, | ||
"gitHead": "4db02fa3977676731a3f5694cc5f72c660b14893" | ||
"gitHead": "bfac2bb103bbd469c4db99c5b854058fd9cc851c" | ||
} |
@@ -86,2 +86,14 @@ (function(lwc) { | ||
function stylesheet(hostSelector, shadowSelector, nativeShadow) { | ||
return ( | ||
"\n" + | ||
(nativeShadow | ||
? ":host {color: var(--lwc-my-color);}" | ||
: hostSelector + " {color: var(--lwc-my-color);}") + | ||
"\n" | ||
); | ||
} | ||
var _implicitStylesheets = [stylesheet]; | ||
function tmpl($api, $cmp, $slotset, $ctx) { | ||
@@ -105,7 +117,16 @@ var api_dynamic = $api._ES5ProxyType ? $api.get("d") : $api.d, | ||
__setKey(tmpl, "stylesheetTokens", { | ||
hostAttribute: "x-foo_foo-host", | ||
shadowAttribute: "x-foo_foo" | ||
}); | ||
if (_implicitStylesheets) { | ||
__callKey2( | ||
(tmpl._ES5ProxyType ? tmpl.get("stylesheets") : tmpl.stylesheets).push, | ||
"apply", | ||
tmpl._ES5ProxyType ? tmpl.get("stylesheets") : tmpl.stylesheets, | ||
_implicitStylesheets | ||
); | ||
} | ||
__setKey(tmpl, "stylesheetTokens", { | ||
hostAttribute: "x-foo_foo-host", | ||
shadowAttribute: "x-foo_foo" | ||
}); | ||
var Foo = | ||
@@ -112,0 +133,0 @@ /*#__PURE__*/ |
(function (lwc) { | ||
'use strict'; | ||
function stylesheet(hostSelector, shadowSelector, nativeShadow) { | ||
return ( | ||
"\n" + | ||
(nativeShadow | ||
? ":host {color: var(--lwc-my-color);}" | ||
: hostSelector + " {color: var(--lwc-my-color);}") + | ||
"\n" | ||
); | ||
} | ||
var _implicitStylesheets = [stylesheet]; | ||
function tmpl($api, $cmp, $slotset, $ctx) { | ||
@@ -16,2 +27,6 @@ const { | ||
tmpl.stylesheets = []; | ||
if (_implicitStylesheets) { | ||
tmpl.stylesheets.push.apply(tmpl.stylesheets, _implicitStylesheets); | ||
} | ||
tmpl.stylesheetTokens = { | ||
@@ -18,0 +33,0 @@ hostAttribute: "x-foo_foo-host", |
@@ -33,2 +33,19 @@ /* | ||
}); | ||
it(`simple app with CSS resolver`, () => { | ||
const entry = path.join(simpleAppDir, 'main.js'); | ||
const rollupCompileOptions = { | ||
stylesheetConfig: { | ||
customProperties: { | ||
resolution: { | ||
type: 'module', | ||
name: 'myCssResolver' | ||
} | ||
} | ||
} | ||
}; | ||
return doRollup(entry, { compat : false }, rollupCompileOptions).then(({ code: actual }) => { | ||
const expected = fsExpected('expected_default_config_simple_app_css_resolver'); | ||
expect(pretty(actual)).toBe(pretty(expected)); | ||
}); | ||
}); | ||
}); | ||
@@ -46,5 +63,5 @@ | ||
const globalModules = { lwc: 'Engine' }; | ||
const globalModules = { lwc: 'Engine', myCssResolver: 'resolveCss' }; | ||
function doRollup(input, { compat } = {}) { | ||
function doRollup(input, { compat } = {}, rollupCompileOptions) { | ||
return rollup.rollup({ | ||
@@ -54,3 +71,3 @@ input, | ||
plugins: [ | ||
rollupCompile(), | ||
rollupCompile(rollupCompileOptions), | ||
compat && rollupCompat({ polyfills: false }) | ||
@@ -57,0 +74,0 @@ ].filter(Boolean), |
@@ -95,3 +95,4 @@ /* | ||
moduleSpecifier: moduleRegistry.moduleSpecifier, | ||
outputConfig: { sourcemap: mergedPluginOptions.sourcemap } | ||
outputConfig: { sourcemap: mergedPluginOptions.sourcemap }, | ||
stylesheetConfig: mergedPluginOptions.stylesheetConfig | ||
}); | ||
@@ -98,0 +99,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21635
21
621
+ Added@lwc/module-resolver@0.33.28-alpha1(transitive)
- Removed@lwc/module-resolver@0.33.27-alpha2(transitive)