Skip to content

Commit

Permalink
v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aMarCruz committed Mar 25, 2019
1 parent fec0c03 commit c32a9b9
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const USE = false

module.exports = {
root: YES,
parser: 'typescript-eslint-parser',
parser: '@typescript-eslint/parser',

parserOptions: {
ecmaVersion: 2016,
Expand Down
52 changes: 42 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,128 @@
# Changes to rollup-plugin-pug

## [1.1.0] - 2018-10-14
<!-- markdownlint-disable MD024 -->

## \[1.1.1] - 2019-03-24

### Changed

- Update devDependencies.

### Fixed

- #14: fix (this.warn is not a function) - thanks to @leptonix
- markdown-lint errors

## \[1.1.0] - 2018-10-14

Mostly internal changes

### Added

- Add `Promise`, `Object` and `Symbol` to the predefined globals.

### Changed

- This version requires node.js 6 or later.
- Deprecate the `local` option as the plugin passes all the options to static templates.
- Hide the internal `runtimeImport` variable.
- Revision of the `transform` method, add comments.
- Avoid type coersion (allows Typescript error detection).

### Removed

- Unused `assign` function, now the plugin uses object spread.
- Removed the ES6 version, seems rollup does not use it.

## [1.0.0] - 2018-09-18
## \[1.0.0] - 2018-09-18

### Added

- Typescript definitions
- Watch the included files in static templates.
- AppVeyor tests.

### Changed

- peerDependencies has rollup>=0.61 to allow dependency detection (see Rollup [#2259](https://github.com/rollup/rollup/pull/2259))
- Updated devDependencies
- Now the development of this plugin uses rollup v0.66 and Typescript v3.0

### Removed

- Dependency on rollup-plugin-buble as Rollup does not depends on it.

## [0.1.6] - 2017-06-21
## \[0.1.6] - 2017-06-21

### Changed

- Updated devDependencies.

### Fixed

- Fixes package installation.

## [0.1.5] - 2017-06-20
## \[0.1.5] - 2017-06-20

### Added

- A custom runtime can be set through the `pugRuntime` option.
- `pugRuntime: false` avoids importation of the pug-runtime.

### Fixed

- The pug option `inlineRuntimeFunctions` is honored and the runtime is not imported.

## [0.1.4] - 2017-05-18
## \[0.1.4] - 2017-05-18

### Added

- Support for ES6 `import` statements in one-line unbuffered code (starting with dash).

### Changed

- Pug `render` method is used instead `compile` and receives `locals` and all the plugin options as parameter, so `_pug_options` is not used anymore (thanks to @StreetStrider).

## [0.1.3] - 2017-03-11
## \[0.1.3] - 2017-03-11

### Added

- For static compilation, all the compiler options are passed through the `_pug_options` value to the template.

### Changed

- Using the lastest Pug version.
- Updated devDependencies.

## [0.1.2] - 2016-11-02
## \[0.1.2] - 2016-11-02

### Fixed

- Minor fix to `compileDebug` forced to `true` on source map generation.

## [0.1.1] - 2016-11-02
## \[0.1.1] - 2016-11-02

### Changed

- `sourceMap` is enabled without the `compileDebug`, regression of this option to `false`.
- Updated gen-pug-source-map devDependency to v0.1.1, almost ready for production.

## [0.1.0] - 2016-10-31
## \[0.1.0] - 2016-10-31

Complete rewrite, WIP

### Added

- Experimental support for source maps.
- Now the plugin imports an internal version of the pug-runtime *if* is necessary, so you don't have to worry about this anymore.
- The new property `locals` is a plain JavaScript object with values passed to the compiler for static compilation.
- The new property `staticPattern` is a regex that matches filenames to compile and evaluate at build time to produce plain HTML, so the loading of templates is faster, useful in SSR.

### Changed

- The `basedir` option defaults to the absolute path of your rollup `entry` file.
- Files from the `extend` and `include` directives are imported by the template, so changes in this dependencies must update the template in watch mode - See issue [#3](https://github.com/aMarCruz/rollup-plugin-pug/issues/3).

## [0.0.2] - 2016-08-28
## \[0.0.2] - 2016-08-28

- Initial release
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# rollup-plugin-pug

[![License][license-image]][license-url]
[![npm Version][npm-image]][npm-url]
[![Linux build Status][build-image]][build-url]
[![Windows build status][appveyor-image]][appveyor-url]
[![npm Version][npm-image]][npm-url]
[![License][license-image]][license-url]

[Rollup](https://github.com/rollup/rollup) plugin that transforms [Pug](https://pugjs.org) v2 templates to ES6 modules.

* Dynamic generation of HTML. Static HTML is optional and configurable.
* Automatic `import` of the pug-runtime in your bundle, if required.
* Automatic `import` of template `extends` and `includes`.
* Source map support.
* Support for ES6 `import` statements (moved out of the template).
* Typescript v3.x definitions.
- Dynamic generation of HTML. Static HTML is optional and configurable.
- Automatic `import` of the pug-runtime in your bundle, if required.
- Automatic `import` of template `extends` and `includes`.
- Source map support.
- Support for ES6 `import` statements (moved out of the template).
- Typescript v3.x definitions.

## IMPORTANT

Expand Down Expand Up @@ -69,7 +69,6 @@ rollup({

That's it.


## Options

In addition to the regular pug options, the plugin defines these:
Expand All @@ -90,7 +89,6 @@ The parameter passed to the static templates is a shallow copy of the plugin opt

When a template matches the `staticPattern` regex, the template is executed at complie-time and you load the resulting string through `import` at runtime, so it will not have access to runtime variables or methods. Instead, the plugin passes its options to the template at compile-time.


## Default Options

The plugin has preset the following options:
Expand All @@ -111,12 +109,12 @@ See the full list and explanation in the [API Documentation](https://pugjs.org/a

Note: The default of `staticPattern` was defined to be compatibile with the old Jade plugin and so it has remained, but I prefer `/\.html\.pug$/`.


## Custom runtime

The `pugRuntime` option can be set to `false` to avoid importing the runtime, but you must provide an equivalent `pug` object accessible to the template:

Disable the predefined runtime in rollup.config.js

```js
...
plugins: [
Expand All @@ -125,13 +123,15 @@ Disable the predefined runtime in rollup.config.js
```

and import the yours in your .pug files

```jade
- import pug from 'my-runtime'
p= name
//- ...etc
```

but the recommended option is name it in the config:

```js
// in rollup.config.js
...
Expand All @@ -142,19 +142,23 @@ but the recommended option is name it in the config:

Search for "pugRuntime" in the `test/run.js` file to see examples.


## What's New

See the [CHANGELOG](CHANGELOG.md) for changes.
### v1.1.1

- #14: fix (this.warn is not a function) - thanks to @leptonix

See the [CHANGELOG](CHANGELOG.md) for more changes.

## Support my Work

I'm a full-stack developer with more than 20 year of experience and I try to share most of my work for free and help others, but this takes a significant amount of time and effort so, if you like my work, please consider...

[![Buy Me a Coffee][bmc-image]][bmc-url]
<!-- markdownlint-disable MD033 -->

[<img src="https://amarcruz.github.io/images/kofi_blue.png" height="36" title="Support Me on Ko-fi" />][kofi-url]

Of course, feedback, PRs stars, and smiles are also welcome :)
Of course, feedback, PRs, and stars are also welcome 🙃

Thanks for your support!

Expand All @@ -166,5 +170,4 @@ Thanks for your support!
[npm-url]: https://www.npmjs.com/package/rollup-plugin-pug
[license-image]: https://img.shields.io/npm/l/express.svg
[license-url]: https://github.com/aMarCruz/rollup-plugin-pug/blob/master/LICENSE
[bmc-image]: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png
[bmc-url]: https://www.buymeacoffee.com/aMarCruz
[kofi-url]: https://ko-fi.com/C0C7LF7I
2 changes: 1 addition & 1 deletion dist/rollup-plugin-pug.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* rollup-plugin-pug v1.1.0
* rollup-plugin-pug v1.1.1
* @author aMarCruz'
* @license MIT'
*/
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-pug",
"version": "1.1.0",
"version": "1.1.1",
"description": "Transforms Pug (aka Jade) templates to ES6 modules.",
"main": "dist/rollup-plugin-pug.js",
"scripts": {
Expand Down Expand Up @@ -38,6 +38,7 @@
"rollup-pluginutils": "^2.3.3"
},
"devDependencies": {
"@typescript-eslint/parser": "^1.5.0",
"eslint": "^5.7.0",
"istanbul": "^0.4.5",
"mocha": "^5.2.0",
Expand All @@ -46,8 +47,7 @@
"rollup-plugin-alias": "^1.4.0",
"rollup-plugin-typescript2": "^0.17.0",
"tslib": "^1.9.3",
"typescript": "3.0.3",
"typescript-eslint-parser": "^20.0.0"
"typescript": "~3.3.0"
},
"peerDependencies": {
"rollup": ">=0.61"
Expand Down

0 comments on commit c32a9b9

Please sign in to comment.