Skip to content

Commit 0f0ffc2

Browse files
author
evilebottnawi
committed
Initial public release.
1 parent 10df09a commit 0f0ffc2

File tree

14 files changed

+722
-0
lines changed

14 files changed

+722
-0
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.gitattributes

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Autodetect text files
2+
* text=auto
3+
4+
# ...Unless the name matches the following overriding patterns
5+
6+
# Definitively text files
7+
.* text eol=lf
8+
*.php text eol=lf
9+
*.css text eol=lf
10+
*.js text eol=lf
11+
*.html text eol=lf
12+
*.json text eol=lf
13+
*.less text eol=lf
14+
*.scss text eol=lf
15+
*.sass text eol=lf
16+
*.txt text eol=lf
17+
*.md text eol=lf
18+
*.markdown text eol=lf
19+
*.xml text eol=lf
20+
*.json text eol=lf
21+
*.bat text eol=lf
22+
*.sh text eolf=lf
23+
*.svg text eol=lf
24+
*.sql text eol=lf
25+
*.xml text eol=lf
26+
*.yml text eol=lf
27+
*.py text eol=lf
28+
*.rb text eol=lf
29+
30+
# Ensure those won't be messed up with
31+
*.ico binary
32+
*.png binary
33+
*.jpg binary
34+
*.jpeg binary
35+
*.webp binary
36+
*.gif binary
37+
*.eot binary
38+
*.ttf binary
39+
*.woff binary
40+
*.woff2 binary
41+
*.mp3 binary
42+
*.m4a binary
43+
*.mp4 binary
44+
*.m4p binary
45+
*.acc binary
46+
47+
# Don't diff or textually merge source maps
48+
*.map binary

.gitignore

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Git files
2+
*.diff
3+
*.orig
4+
*.rej
5+
6+
# Numerous always-ignore extensions
7+
pids
8+
*.pid
9+
*.seed
10+
*.lock
11+
*.err
12+
*.tmp
13+
*.log*
14+
15+
# Text Editors
16+
.swo
17+
*.swp
18+
*.vi
19+
[._]*.s[a-w][a-z]
20+
[._]s[a-w][a-z]
21+
Session.vim
22+
.netrwhist
23+
*~
24+
25+
# Numerous always-ignore directories
26+
logs
27+
tmp
28+
29+
# Windows files and directories
30+
Thumbs.db
31+
32+
# Mac files and directories
33+
.DS_Store
34+
.AppleDouble
35+
.LSOverride
36+
.Spotlight-V100
37+
.Trashes
38+
.AppleDB
39+
.AppleDesktop
40+
Network Trash Folder
41+
Temporary Items
42+
.apdisk
43+
44+
# Thumbnails
45+
._*
46+
47+
# IntelliJ IDEA and other products
48+
*.iml
49+
.idea
50+
release
51+
52+
# VSCode metadata
53+
.vscode
54+
55+
# Sublime
56+
*.sublime-project
57+
*.sublime-workspace
58+
.sublimelinterrc
59+
60+
# Eclipse
61+
.project
62+
.classpath
63+
.settings
64+
65+
# gitkeep
66+
!.gitkeep
67+
68+
# Directory for instrumented libs generated by jscoverage/JSCover
69+
lib-cov
70+
71+
# Coverage directory used by tools like istanbul
72+
coverage
73+
74+
# nyc test coverage
75+
.nyc_output
76+
77+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
78+
.grunt
79+
80+
# node-waf configuration
81+
.lock-wscript
82+
83+
# Compiled binary addons (http://nodejs.org/api/addons.html)
84+
build/Release
85+
86+
# Dependency directories
87+
bower_components
88+
.bower-cache
89+
.bower-registry
90+
.bower-tmp
91+
node_modules
92+
jspm_packages
93+
94+
# Optional npm cache directory
95+
.npm
96+
97+
# Optional REPL history
98+
.node_repl_history
99+
100+
# Ignore minified files
101+
*.min.*
102+
103+
# Caches
104+
.cache
105+
.eslintcache
106+
.eclintercache
107+
.stylelintcache
108+
109+
# Yarn
110+
!yarn.lock
111+
112+
# Composer
113+
composer.phar
114+
vendor
115+
116+
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
117+
# You may choose to publish a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
118+
# !composer.lock
119+
120+
# Applcation
121+
build
122+
src/shared/fonts/icon-font.*
123+
src/shared/styles/fonts/_icon-font.scss

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
sudo: false
2+
3+
language: node_js
4+
5+
node_js:
6+
- '7'
7+
- '6'
8+
- '5'
9+
- '4'
10+
11+
cache:
12+
directories:
13+
- node_modules
14+
15+
before_install:
16+
- npm prune
17+
- npm update

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
This project adheres to [Semantic Versioning](http://semver.org/).
6+
7+
# 1.0.0 - 2017-04-06
8+
9+
- Initial public release.

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# nunjucks-webpack-plugin
2+
3+
[![NPM version](https://img.shields.io/npm/v/nunjucks-webpack-plugin.svg)](https://www.npmjs.org/package/nunjucks-webpack-plugin)
4+
[![Travis Build Status](https://img.shields.io/travis/itgalaxy/nunjucks-webpack-plugin/master.svg?label=build)](https://travis-ci.org/itgalaxy/nunjucks-webpack-plugin)
5+
[![devDependencies Status](https://david-dm.org/itgalaxy/nunjucks-webpack-plugin/dev-status.svg)](https://david-dm.org/itgalaxy/nunjucks-webpack-plugin?type=dev)
6+
[![peerDependencies Status](https://david-dm.org/itgalaxy/nunjucks-webpack-plugin/peer-status.svg)](https://david-dm.org/itgalaxy/nunjucks-webpack-plugin?type=peer)
7+
8+
A webpack plugin for nunjucks.
9+
10+
## Install
11+
12+
```shell
13+
npm install --save-dev nunjucks-webpack-plugin
14+
```
15+
16+
## Usage
17+
18+
```js
19+
import NunjucksWebpackPlugin from 'nunjucks-webpack-plugin';
20+
21+
export default {
22+
plugins: [
23+
new NunjucksWebpackPlugin({
24+
template: {
25+
from: '/path/to/template.njk',
26+
to: 'template.html'
27+
}
28+
})
29+
]
30+
};
31+
```
32+
33+
## Options
34+
35+
- `template` - (require) `object` or `array` paths (`from`, `to` and etc.) to templates.
36+
37+
- `from` - (require) `string` path to template.
38+
39+
- `to` - (require) `string` destination path include filename and extension (relative `output` webpack option).
40+
41+
- `context` - (optional) instead global context (see above),
42+
see [render](https://mozilla.github.io/nunjucks/api.html#render) second argument.
43+
44+
- `callback` - (optional) instead global callback (see above),
45+
see [render](https://mozilla.github.io/nunjucks/api.html#render) third argument.
46+
47+
- `context` - (optional) use if template `context` is null or undefined,
48+
see [render](https://mozilla.github.io/nunjucks/api.html#render) second argument.
49+
50+
- `callback` - (optional) use if template `callback` is null or undefined,
51+
see [render](https://mozilla.github.io/nunjucks/api.html#render) third argument.
52+
53+
- `configure` - (optional) see [configure](https://mozilla.github.io/nunjucks/api.html#configure) options.
54+
55+
- `writeToFileWhenMemoryFs` - (optional, default: true) - write templates to disk when using Memory filesystem,
56+
useful when use `watch`.
57+
58+
## Contribution
59+
60+
Feel free to push your code if you agree with publishing under the MIT license.
61+
62+
## [Changelog](CHANGELOG.md)
63+
64+
## [License](LICENSE)

package.json

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"name": "nunjucks-webpack-plugin",
3+
"version": "1.0.0",
4+
"description": "A webpack plugin for nunjucks",
5+
"keywords": [
6+
"webpack",
7+
"webpack-plugin",
8+
"plugin",
9+
"nunjucks",
10+
"nunj",
11+
"template"
12+
],
13+
"homepage": "https://github.com/itgalaxy/nunjucks-webpack-plugin",
14+
"bugs": {
15+
"url": "https://github.com/itgalaxy/nunjucks-webpack-plugin/issues"
16+
},
17+
"license": "MIT",
18+
"author": "itgalaxy <development@itgalaxy.company>",
19+
"contributors": [
20+
{
21+
"name": "Alexander Krasnoyarov",
22+
"email": "alexander.krasnoyarov@itgalaxy.company",
23+
"url": "https://vk.com/sterling_archer"
24+
}
25+
],
26+
"repository": {
27+
"type": "https",
28+
"url": "https://github.com/itgalaxy/nunjucks-webpack-plugin"
29+
},
30+
"main": "src/NunjucksWebpackPlugin.js",
31+
"files": [
32+
"src",
33+
"!**/__tests__"
34+
],
35+
"dependencies": {},
36+
"devDependencies": {
37+
"ava": "0.19.0",
38+
"ajv-cli": "^1.1.0",
39+
"babel-core": "^6.24.0",
40+
"babel-polyfill": "^6.23.0",
41+
"babel-preset-es2015": "^6.24.0",
42+
"babel-preset-stage-0": "^6.22.0",
43+
"babel-register": "^6.24.0",
44+
"eslint": "^3.15.0",
45+
"eslint-plugin-ava": "^4.2.0",
46+
"eslint-plugin-import": "^2.2.0",
47+
"eslint-plugin-itgalaxy": "^45.0.0",
48+
"eslint-plugin-jsx-a11y": "^4.0.0",
49+
"eslint-plugin-lodash": "^2.4.0",
50+
"eslint-plugin-node": "^4.2.0",
51+
"eslint-plugin-promise": "^3.5.0",
52+
"eslint-plugin-react": "^6.10.0",
53+
"eslint-plugin-unicorn": "^2.1.0",
54+
"npmpub": "^3.1.0",
55+
"npm-run-all": "^4.0.0",
56+
"nyc": "^10.0.0",
57+
"nunjucks": "^3.0.0",
58+
"package-schema": "^1.0.0",
59+
"pify": "^2.3.0",
60+
"remark-cli": "^3.0.0",
61+
"remark-preset-lint-itgalaxy": "^6.0.0",
62+
"tempy": "^0.1.0",
63+
"webpack": "^2.2.1"
64+
},
65+
"peerDependencies": {
66+
"nunjucks": "^3.0.0",
67+
"webpack": "^1.13.2 || ^2.2.1"
68+
},
69+
"scripts": {
70+
"lint:eslint": "eslint . --cache --ignore-path .gitignore",
71+
"lint:package": "ajv -s ./node_modules/package-schema/schema.json -d package --errors=text",
72+
"lint:remark": "remark . -i .gitignore -f -q",
73+
"lint": "npm-run-all -l --parallel lint:*",
74+
75+
"pretest": "npm run lint",
76+
"ava": "nyc ava --verbose \"src/**/__tests__/*.js\"",
77+
"test": "npm run ava",
78+
79+
"release": "npmpub"
80+
},
81+
"ava": {
82+
"require": [
83+
"babel-register",
84+
"babel-polyfill"
85+
],
86+
"concurrency": 5,
87+
"babel": "inherit"
88+
},
89+
"babel": {
90+
"presets": [
91+
"es2015",
92+
"stage-0"
93+
]
94+
},
95+
"eslintConfig": {
96+
"extends": [
97+
"plugin:itgalaxy/ava",
98+
"plugin:itgalaxy/node",
99+
"plugin:itgalaxy/esnext"
100+
],
101+
"root": true
102+
},
103+
"remarkConfig": {
104+
"plugins": [
105+
"remark-preset-lint-itgalaxy"
106+
]
107+
}
108+
}

0 commit comments

Comments
 (0)