Skip to content

Commit 864084b

Browse files
committed
Add support for faucet-pipeline-static
1 parent 1566f93 commit 864084b

File tree

3 files changed

+40
-13
lines changed

3 files changed

+40
-13
lines changed

README.md

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ module.exports = {
167167
sass: {
168168
// configuration for faucet-pipeline-sass
169169
},
170+
static: {
171+
// configuration for faucet-pipeline-static
172+
},
170173
watchDirs: {
171174
// configuration for file watching
172175
}
@@ -178,19 +181,19 @@ only export a `js` option. The pipelines will only be required if you provided
178181
an option for them. Therefore you would only need to install
179182
`faucet-pipeline-js` in that case.
180183

181-
Each of the configurations (`js`, `sass`) requires a `manifest` configuration.
182-
If you don't need a manifest file, set `manifest` to `false`. Otherwise, you
183-
provide an object with two keys: `file` and `baseURI`. `file` is the path where
184-
your manifest file should be written (relative to the config file). `baseURI`
185-
can be either:
184+
Each of the configurations (`js`, `sass`, `static`) requires a `manifest`
185+
configuration. If you don't need a manifest file, set `manifest` to `false`.
186+
Otherwise, you provide an object with two keys: `file` and `baseURI`. `file` is
187+
the path where your manifest file should be written (relative to the config
188+
file). `baseURI` can be either:
186189

187190
1. If your `baseURI` is a String, the manifest values will be generated
188191
like this: `${baseURI}${target}`
189192
2. If your `baseURI` is a function, it will be the return value of your
190193
function. The function will be provided with two arguments: `target` and
191194
`path.basename(target)`.
192195

193-
For example, it could look like this:
196+
For example, it might look like this:
194197

195198
```js
196199
module.exports = {
@@ -207,15 +210,15 @@ module.exports = {
207210
### Configuration for `faucet-pipeline-js`
208211

209212
The configuration has to include a `bundles` key with an array. Each entry of
210-
the array if an object with two keys: `entryPoint` is the file that should be
213+
the array is an object with two keys: `entryPoint` is the file that should be
211214
compiled, and `target` is the file that should be created (the path is, of
212215
course, modified a little when you use fingerprinting). It also has a third,
213216
optional key `transpiler`. If you provide it, the pipeline will transpile ES201*
214217
to ES3. You need to provide an object with a `transpiler` key that has an array
215218
with features that you want to transpile as an argument.
216219

217220
If you for example want to transpile from ES2015 to ES3, your configuration
218-
could look like this:
221+
might look like this:
219222

220223
```js
221224
module.exports = {
@@ -238,7 +241,7 @@ module.exports = {
238241
### Configuration for `faucet-pipeline-sass`
239242

240243
The configuration has to include a `bundles` key with an array. Each entry of
241-
the array if an object with two keys: `entryPoint` is the file that should be
244+
the array is an object with two keys: `entryPoint` is the file that should be
242245
compiled, and `target` is the file that should be created (the path is, of
243246
course, modified a little when you use fingerprinting).
244247

@@ -252,7 +255,7 @@ There are also two optional configurations:
252255
* `prefixes`: A configuration for the
253256
[autoprefixer](https://github.com/postcss/autoprefixer).
254257

255-
The resulting configuration could look something like this:
258+
The resulting configuration might look something like this:
256259

257260
```js
258261
module.exports = {
@@ -283,13 +286,36 @@ module.exports = {
283286
};
284287
```
285288

289+
### Configuration for `faucet-pipeline-static`
290+
291+
The configuration has to include a `bundles` key with an array. Each entry of
292+
the array is an object with two keys: `source` is the folder of files that
293+
should be copied, and `target` is where the files are copied to.
294+
295+
The resulting configuration might look something like this:
296+
297+
```js
298+
module.exports = {
299+
static: {
300+
manifest: {
301+
file: "./dist/manifest.json",
302+
baseURI: "/assets"
303+
},
304+
bundles: [{
305+
source: "src",
306+
target: "dist"
307+
}]
308+
}
309+
};
310+
```
311+
286312
### Configuration for file watching
287313

288314
You don't need to configure anything for file watching. If you, however, want to
289315
be gentle your file watching limit and your notebook charge, you might want to
290316
restrict file watching to certain folders. Per default, it watches the entire
291317
folder the config file is in. The configuration expects an array of strings. The
292-
strings are paths relative to your configuration file. It could look like this:
318+
strings are paths relative to your configuration file. It might look like this:
293319

294320
```js
295321
module.exports = {

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ let path = require("path");
55

66
const PLUGINS = {
77
js: "faucet-pipeline-js",
8-
sass: "faucet-pipeline-sass"
8+
sass: "faucet-pipeline-sass",
9+
static: "faucet-pipeline-static"
910
};
1011

1112
module.exports = (rootDir, config = "faucet.config.js", // eslint-disable-next-line indent

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "faucet-pipeline",
3-
"version": "0.12.0",
3+
"version": "0.13.0",
44
"description": "front-end asset pipeline",
55
"author": "FND",
66
"contributors": [

0 commit comments

Comments
 (0)