Skip to content

Commit

Permalink
Merge branch 'release/1.0.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Nov 22, 2023
2 parents e6ba657 + 0474a9d commit 2f4f46c
Show file tree
Hide file tree
Showing 13 changed files with 2,043 additions and 1,707 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

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

## 1.0.13 - 2023.11.22
### Changed
* Switch over to using Node 20 and NPM 10 in the Dockerfile
* Update to Vite `^5.0.0` and Vitest `^1.0.0-beta.5`

### Fix
* Fix an issue where building with a project of `"type": "module"` would fail because conditional exports were not defined in `"exports"` ([#12](https://github.com/nystudio107/rollup-plugin-critical/issues/12))

## 1.0.12 - 2022.12.12
### Fix
* Fix import of the now ESM-only `critical` package into the CJS build of `rollup-plugin-critical` ([#9](https://github.com/nystudio107/rollup-plugin-critical/issues/9))
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG TAG=16-alpine
ARG TAG=20-alpine
FROM nystudio107/node-dev-base:$TAG

WORKDIR /app/

RUN npm install -g npm@^9.2.0
RUN npm install -g npm@^10.0.0

CMD ["run build"]

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TAG?=16-alpine
TAG?=20-alpine
CONTAINER?=$(shell basename $(CURDIR))
DOCKERRUN=docker container run \
--name ${CONTAINER} \
Expand Down Expand Up @@ -57,7 +57,7 @@ update: docker
update
npm: docker
${DOCKERRUN} \
$(filter-out $@,$(MAKECMDGOALS))
$(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS)
%:
@:
# ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line
2 changes: 2 additions & 0 deletions dist/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";var C=Object.create;var s=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var w=(t,i)=>{for(var c in i)s(t,c,{get:i[c],enumerable:!0})},g=(t,i,c,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of d(i))!b.call(t,a)&&a!==c&&s(t,a,{get:()=>i[a],enumerable:!(r=P(i,a))||r.enumerable});return t};var u=(t,i,c)=>(c=t!=null?C(S(t)):{},g(i||!t||!t.__esModule?s(c,"default",{value:t,enumerable:!0}):c,t)),j=t=>g(s({},"__esModule",{value:!0}),t);var N={};w(N,{default:()=>k});module.exports=j(N);var m=u(require("path"),1),x="_critical.min.css",y={inline:!1,extract:!1,width:1200,height:1200,penthouse:{blockJSRequests:!1}};function B(t,i){return{name:"critical",async writeBundle(c,r){let a=[];for(let e of Object.values(r))if(e.type==="asset"&&e.fileName.endsWith(".css")){let l=m.join(c.dir||"",e.fileName);a.push(l)}if(a.length)for(let e of t.criticalPages){let l=t.criticalBase,o=t.criticalUrl+e.uri,f=t.criticalConfig&&t.criticalConfig.inline==!0?e.template+".html":e.template+x,h=Object.assign({css:a},y,{base:l,src:o,target:f},t.criticalConfig),p=(await import("critical")).generate;console.log(`Generating critical CSS from ${o} to ${f}`),await p(h,n=>{n&&console.error(n),i&&i(n)})}}}}var k=B;
//# sourceMappingURL=index.cjs.map
2 changes: 1 addition & 1 deletion dist/index.mjs.map → dist/index.cjs.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions dist/index.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Plugin } from 'rollup';

/**
* [Vite.js](https://vitejs.dev/) & [Rollup](https://rollupjs.org/) plugin for generating critical CSS
* that uses the [critical](https://github.com/addyosmani/critical) generator under the hood.
*
* @param {CriticalPluginConfig} pluginConfig - the plugin configuration object
* @param {Function} callback - callback upon completion of the critical CSS generation
* @constructor
*/
declare function PluginCritical(pluginConfig: CriticalPluginConfig, callback?: CriticalPluginCallback): Plugin;

export { PluginCritical as default };
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2f4f46c

Please sign in to comment.