Skip to content

Commit 78510b3

Browse files
committed
Merge branch 'release/1.0.11'
2 parents 601e9b3 + 9685253 commit 78510b3

File tree

12 files changed

+21
-12
lines changed

12 files changed

+21
-12
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 1.0.11 - 2022.12.12
6+
### Changed
7+
* Refactored the tests to use snapshots
8+
9+
### Fixed
10+
* Fixed an issue where the plugin was being bundled as ESM, when it should be CommonJS for broader (and backwards) compatibility ([#9](https://github.com/nystudio107/rollup-plugin-critical/issues/9))
11+
512
## 1.0.10 - 2022.12.11
613
### Added
714
* Add `eslint` to the build phase

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ npm i -D rollup-plugin-critical
1919
```js
2020
// rollup.config.js
2121

22-
import {PluginCritical} from 'rollup-plugin-critical';
22+
import PluginCritical from 'rollup-plugin-critical';
2323

2424
export default {
2525
input: 'index.js',

dist/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ import { Plugin } from 'rollup';
1010
*/
1111
declare function PluginCritical(pluginConfig: CriticalPluginConfig, callback?: CriticalPluginCallback): Plugin;
1212

13-
export { PluginCritical };
13+
export { PluginCritical as default };

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import*as n from"path";import{generate as g}from"critical";var u="_critical.min.css",h={inline:!1,extract:!1,width:1200,height:1200,penthouse:{blockJSRequests:!1}};function C(t,r){return{name:"critical",async writeBundle(o,f){let c=[];for(let i of Object.values(f))if(i.type==="asset"&&i.fileName.endsWith(".css")){let a=n.join(o.dir||"",i.fileName);c.push(a)}if(!!c.length)for(let i of t.criticalPages){let a=t.criticalBase,s=t.criticalUrl+i.uri,l=t.criticalConfig&&t.criticalConfig.inline==!0?i.template+".html":i.template+u,m=Object.assign({css:c},h,{base:a,src:s,target:l},t.criticalConfig);console.log(`Generating critical CSS from ${s} to ${l}`),await g(m,e=>{e&&console.error(e),r&&r(e)})}}}}export{C as PluginCritical};
1+
import*as n from"path";import{generate as u}from"critical";var g="_critical.min.css",h={inline:!1,extract:!1,width:1200,height:1200,penthouse:{blockJSRequests:!1}};function p(i,r){return{name:"critical",async writeBundle(o,f){let c=[];for(let t of Object.values(f))if(t.type==="asset"&&t.fileName.endsWith(".css")){let a=n.join(o.dir||"",t.fileName);c.push(a)}if(!!c.length)for(let t of i.criticalPages){let a=i.criticalBase,s=i.criticalUrl+t.uri,l=i.criticalConfig&&i.criticalConfig.inline==!0?t.template+".html":t.template+g,m=Object.assign({css:c},h,{base:a,src:s,target:l},i.criticalConfig);console.log(`Generating critical CSS from ${s} to ${l}`),await u(m,e=>{e&&console.error(e),r&&r(e)})}}}}var P=p;export{P as default};
22
//# sourceMappingURL=index.mjs.map

0 commit comments

Comments
 (0)