faucet-pipeline-css 0.4.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.woodpecker/test.yml +15 -0
  2. package/CHANGELOG.md +31 -1
  3. package/README.md +3 -1
  4. package/lib/index.js +14 -24
  5. package/lib/make-esbuild.js +43 -0
  6. package/lib/resolver.js +29 -0
  7. package/lib/transforms.js +15 -0
  8. package/package.json +10 -13
  9. package/test/run +7 -2
  10. package/test/test_assets_integration/expected.css +5 -0
  11. package/test/test_assets_integration/faucet.config.js +18 -0
  12. package/test/test_assets_integration/src/index.css +4 -0
  13. package/test/test_basic/expected.css +7 -2
  14. package/test/test_basic/faucet.config.js +7 -9
  15. package/test/test_basic/src/index.css +4 -0
  16. package/test/test_compact/expected.css +1 -1
  17. package/test/test_compact/faucet.config.js +7 -9
  18. package/test/test_error/expected.css +1 -1
  19. package/test/test_error/faucet.config.js +7 -9
  20. package/test/test_fingerprinting/expected.css +4 -2
  21. package/test/test_fingerprinting/expected.json +1 -1
  22. package/test/test_fingerprinting/faucet.config.js +15 -16
  23. package/test/test_sourcemap/expected.css +4 -3
  24. package/test/test_sourcemap/expected.css.map +1 -1
  25. package/test/test_sourcemap/faucet.config.js +7 -9
  26. package/test/test_transform/expected.css +12 -0
  27. package/test/test_transform/faucet.config.js +9 -0
  28. package/test/test_transform/src/index.css +9 -0
  29. package/test/test_transform/src/lib.css +3 -0
  30. package/.github/dependabot.yml +0 -13
  31. package/.github/workflows/tests.yaml +0 -20
  32. package/lib/asset-url.js +0 -14
  33. package/lib/make-postcss.js +0 -55
  34. package/test/test_static_integration/expected.css +0 -4
  35. package/test/test_static_integration/faucet.config.js +0 -18
  36. package/test/test_static_integration/src/index.css +0 -4
  37. /package/test/{test_static_integration → test_assets_integration}/expected.json +0 -0
  38. /package/test/{test_static_integration → test_assets_integration}/src/spacer.gif +0 -0
@@ -0,0 +1,15 @@
1
+ when:
2
+ - event: push
3
+
4
+ matrix:
5
+ NODE_VERSION:
6
+ - 22-trixie
7
+ - 24-trixie
8
+ - latest
9
+
10
+ steps:
11
+ test:
12
+ image: docker.io/library/node:${NODE_VERSION}
13
+ commands:
14
+ - node --version
15
+ - npm install-test
package/CHANGELOG.md CHANGED
@@ -1,6 +1,36 @@
1
1
  faucet-pipeline-css version history
2
2
  ===================================
3
3
 
4
+ v1.0.0
5
+ ------
6
+
7
+ _2026-09-16_
8
+
9
+ notable changes for end users:
10
+
11
+ * ensured compatibility with faucet-pipeline-core v4
12
+ * updated dependencies
13
+
14
+
15
+ v0.5.0
16
+ ------
17
+
18
+ _2026-04-07_
19
+
20
+ notable changes for end users:
21
+
22
+ * **Breaking Change:** added fingerprint integration to `url`
23
+ and removed `asset-url`.
24
+ * added support for transforming CSS nesting enabled by adding
25
+ `transform: ["nesting"]` to the configuration.
26
+ * dropped support for Node 21 and below
27
+ * update dependencies
28
+
29
+ notable changes for developers:
30
+ * moved from GitHub to Codeberg
31
+ * switched from CJS to ESM
32
+
33
+
4
34
  v0.4.0
5
35
  ------
6
36
 
@@ -39,7 +69,7 @@ notable changes for end users:
39
69
 
40
70
  * updated dependencies
41
71
 
42
- notable changes for end developers:
72
+ notable changes for developers:
43
73
 
44
74
  * updated to new PostCSS API
45
75
  * switched to Github Actions and Dependabot
package/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # faucet-pipeline-css
2
2
  [![npm](https://img.shields.io/npm/v/faucet-pipeline-css.svg)](https://www.npmjs.com/package/faucet-pipeline-css)
3
3
 
4
- You can find the documentation [here](http://www.faucet-pipeline.org/css).
4
+ See [faucet-pipeline.org/css](https://www.faucet-pipeline.org/css) for documentation.
5
+
6
+ You can find the [source code on Codeberg](https://codeberg.org/faucet-pipeline/faucet-pipeline-css).
5
7
 
6
8
  ## License
7
9
 
package/lib/index.js CHANGED
@@ -1,23 +1,20 @@
1
- let { abort } = require("faucet-pipeline-core/lib/util");
2
- let path = require("path");
3
- let makePostCSS = require("./make-postcss");
1
+ import { abort } from "faucet-pipeline-core/lib/util/index.js";
2
+ import path from "node:path";
3
+ import { makeESBuild } from "./make-esbuild.js";
4
4
 
5
- module.exports = {
6
- key: "css",
7
- bucket: "styles",
8
- plugin: faucetCSS
9
- };
5
+ export let key = "css";
6
+ export let bucket = "styles";
10
7
 
11
- function faucetCSS(config, assetManager, { browsers, compact, sourcemaps } = {}) {
8
+ export function plugin(config, assetManager, { compact, sourcemaps } = {}) {
12
9
  let bundlers = config.map(bundleConfig => makeBundler(bundleConfig,
13
- assetManager, { browsers, compact, sourcemaps }));
10
+ assetManager, { compact, sourcemaps }));
14
11
 
15
12
  return filepaths => Promise.all(bundlers.
16
13
  map(bundler => bundler(filepaths)));
17
14
  }
18
15
 
19
- function makeBundler(config, assetManager, { browsers, compact, sourcemaps } = {}) {
20
- let { browserslist, fingerprint } = config;
16
+ function makeBundler(config, assetManager, { compact, sourcemaps } = {}) {
17
+ let { fingerprint } = config;
21
18
 
22
19
  if(!config.source || !config.target) {
23
20
  abort("ERROR: CSS configuration requires both target and source");
@@ -25,22 +22,15 @@ function makeBundler(config, assetManager, { browsers, compact, sourcemaps } = {
25
22
 
26
23
  let source = assetManager.resolvePath(config.source);
27
24
  let target = assetManager.resolvePath(config.target, { enforceRelative: true });
25
+ let { transform } = config;
28
26
 
29
- if(browserslist === false) {
30
- browsers = null;
31
- } else if(browserslist) {
32
- browsers = browsers[browserslist];
33
- } else {
34
- browsers = browsers.defaults;
35
- }
36
-
37
- let postCSS = makePostCSS(
27
+ let esbuild = makeESBuild(
38
28
  source,
39
29
  target,
40
30
  assetManager,
41
31
  sourcemaps,
42
- browsers,
43
- compact
32
+ compact,
33
+ transform
44
34
  );
45
35
 
46
36
  let previouslyIncludedFiles;
@@ -49,7 +39,7 @@ function makeBundler(config, assetManager, { browsers, compact, sourcemaps } = {
49
39
  // If this is the first run or the changed file is one of the
50
40
  // previously included ones, run the compiler
51
41
  if(previouslyIncluded(filepaths, previouslyIncludedFiles)) {
52
- return postCSS().
42
+ return esbuild().
53
43
  then(result => {
54
44
  previouslyIncludedFiles = result.stats.includedFiles.
55
45
  map(filepath => path.normalize(filepath));
@@ -0,0 +1,43 @@
1
+ import { build } from "esbuild";
2
+ import { Resolver } from "./resolver.js";
3
+ import { supportedFeaturesFor } from "./transforms.js";
4
+
5
+ export function makeESBuild(input, target, assetManager, sourcemaps, compact, transform) {
6
+ let resolver = new Resolver(assetManager.manifest);
7
+
8
+ return async function() {
9
+ let { outputFiles, errors, warnings } = await build({
10
+ entryPoints: [input],
11
+ bundle: true,
12
+ write: false,
13
+ minifyWhitespace: compact,
14
+ sourcemap: sourcemaps ? "inline" : false,
15
+ supported: supportedFeaturesFor(transform),
16
+ plugins: [{
17
+ name: "faucet-resolver",
18
+ setup(build) {
19
+ build.onResolve({ filter: /.*/ }, resolver.resolve);
20
+ }
21
+ }],
22
+ outfile: target
23
+ });
24
+
25
+ // we treat warnings as errors, too
26
+ if(errors.length > 0 || warnings.length > 0) {
27
+ throw buildError([...errors, ...warnings]);
28
+ }
29
+
30
+ return {
31
+ css: outputFiles[0].contents,
32
+ stats: {
33
+ includedFiles: resolver.includedFiles
34
+ }
35
+ };
36
+ };
37
+ }
38
+
39
+ // builds an error for the first error
40
+ function buildError(messages) {
41
+ let { location, text } = messages[0];
42
+ return new Error(`${location.file}:${location.line}:${location.column}: ${text}`);
43
+ }
@@ -0,0 +1,29 @@
1
+ import { join, isAbsolute } from "path";
2
+
3
+ export class Resolver {
4
+ constructor(manifest) {
5
+ this.manifest = manifest;
6
+ this._includedFiles = new Set();
7
+ this.resolve = this.resolve.bind(this);
8
+ }
9
+
10
+ resolve({ path, resolveDir, kind }) {
11
+ if(kind === "url-token") {
12
+ return {
13
+ external: true,
14
+ path: this.manifest.get(path)
15
+ };
16
+ }
17
+
18
+ if(!isAbsolute(path)) {
19
+ path = join(resolveDir, path);
20
+ }
21
+ this._includedFiles.add(path);
22
+
23
+ return { path };
24
+ }
25
+
26
+ get includedFiles() {
27
+ return Array.from(this._includedFiles);
28
+ }
29
+ }
@@ -0,0 +1,15 @@
1
+ let SUPPORTED_TRANSFORMS = ["nesting"];
2
+
3
+ // all transforms need to be converted into not supported features
4
+ export function supportedFeaturesFor(transforms = []) {
5
+ let supported = {};
6
+
7
+ for(let transform of transforms) {
8
+ if(!SUPPORTED_TRANSFORMS.includes(transform)) {
9
+ throw new Error(`Unknown transform: '${transform}`);
10
+ }
11
+ supported[transform] = false;
12
+ }
13
+
14
+ return supported;
15
+ }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "faucet-pipeline-css",
3
- "version": "0.4.0",
3
+ "version": "1.0.0",
4
4
  "description": "CSS for faucet-pipeline",
5
5
  "main": "lib/index.js",
6
+ "type": "module",
6
7
  "scripts": {
7
8
  "test": "npm-run-all --parallel lint test:cli",
8
9
  "test:cli": "./test/run",
@@ -10,28 +11,24 @@
10
11
  },
11
12
  "repository": {
12
13
  "type": "git",
13
- "url": "git+https://github.com/faucet-pipeline/faucet-pipeline-css.git"
14
+ "url": "https://codeberg.org/faucet-pipeline/faucet-pipeline-css.git"
14
15
  },
15
- "author": "Lucas Dohmen <lucas@dohmen.io> (https://lucas.dohmen.io/)",
16
+ "author": "Lucas Dohmen <lucas@dohmen.io> (https://lucas.dohmen.io)",
16
17
  "license": "Apache-2.0",
17
18
  "bugs": {
18
- "url": "https://github.com/faucet-pipeline/faucet-pipeline-css/issues"
19
+ "url": "https://codeberg.org/faucet-pipeline/faucet-pipeline-css/issues"
19
20
  },
20
- "homepage": "https://www.faucet-pipeline.org",
21
+ "homepage": "https://www.faucet-pipeline.org/css",
21
22
  "engines": {
22
- "node": ">= 20"
23
+ "node": ">= 22"
23
24
  },
24
25
  "dependencies": {
25
- "faucet-pipeline-core": "^2.1.0",
26
- "postcss": "~8.5.6",
27
- "postcss-discard-comments": "~7.0.4",
28
- "postcss-import": "~16.1.1",
29
- "postcss-message-helpers": "~2.0.0",
30
- "postcss-normalize-whitespace": "~7.0.1"
26
+ "esbuild": "^0.28.2",
27
+ "faucet-pipeline-core": "^2.1.0 || ^4.0.0"
31
28
  },
32
29
  "devDependencies": {
33
30
  "eslint-config-fnd": "^1.13.0",
34
- "faucet-pipeline-static": "^2.1.0",
31
+ "faucet-pipeline-assets": "^1.0.0",
35
32
  "json-diff": "^1.0.0",
36
33
  "npm-run-all": "^4.1.5",
37
34
  "release-util-fnd": "^3.0.0"
package/test/run CHANGED
@@ -17,6 +17,11 @@ begin "$root/test_compact"
17
17
  assert_identical "./dist/bundle.css" "./expected.css"
18
18
  end
19
19
 
20
+ begin "$root/test_transform"
21
+ faucet
22
+ assert_identical "./dist/bundle.css" "./expected.css"
23
+ end
24
+
20
25
  begin "$root/test_error"
21
26
  faucet || echo "Crashed successfully"
22
27
  assert_identical "./dist/bundle.css" "./expected.css"
@@ -24,7 +29,7 @@ end
24
29
 
25
30
  begin "$root/test_fingerprinting"
26
31
  faucet --fingerprint
27
- assert_identical "./dist/fingerprint/bundle-12c46b3f47e2c83fc4f31fb2d6564c51.css" "./expected.css"
32
+ assert_identical "./dist/fingerprint/bundle-dabc1c684fd0fcf8aa3655ba0a1af7e268153ce4e73cb524b4507dce403d5557.css" "./expected.css"
28
33
  assert_identical "./dist/no-fingerprint/bundle.css" "./expected.css"
29
34
  assert_json "./dist/manifest.json" "./expected.json"
30
35
  end
@@ -34,7 +39,7 @@ begin "$root/test_sourcemap"
34
39
  assert_identical_sourcemap "./dist/bundle.css" "./expected.css" "./expected.css.map"
35
40
  end
36
41
 
37
- begin "$root/test_static_integration"
42
+ begin "$root/test_assets_integration"
38
43
  faucet
39
44
  assert_identical "./dist/bundle.css" "./expected.css"
40
45
  end
@@ -0,0 +1,5 @@
1
+ /* src/index.css */
2
+ .bla {
3
+ background: url(/assets/dist/spacer.gif);
4
+ color: green;
5
+ }
@@ -0,0 +1,18 @@
1
+ import { resolve } from "node:path";
2
+
3
+ export const css = [{
4
+ source: "./src/index.css",
5
+ target: "./dist/bundle.css"
6
+ }];
7
+
8
+ export const assets = [{
9
+ source: "./src/spacer.gif",
10
+ target: "./dist/spacer.gif"
11
+ }];
12
+
13
+ export const manifest = {
14
+ target: "./dist/manifest.json",
15
+ value: f => `/assets/${f}`
16
+ };
17
+
18
+ export const plugins = [resolve(import.meta.dirname, "../..")];
@@ -0,0 +1,4 @@
1
+ .bla {
2
+ background: url("dist/spacer.gif");
3
+ color: green;
4
+ }
@@ -1,7 +1,12 @@
1
+ /* src/lib.css */
1
2
  .bar {
2
- color: red;
3
+ color: red;
3
4
  }
4
5
 
6
+ /* src/index.css */
5
7
  .foo {
6
- color: green;
8
+ color: green;
9
+ .baz {
10
+ color: hotpink;
11
+ }
7
12
  }
@@ -1,10 +1,8 @@
1
- "use strict";
2
- let path = require("path");
1
+ import { resolve } from "node:path";
3
2
 
4
- module.exports = {
5
- css: [{
6
- source: "./src/index.css",
7
- target: "./dist/bundle.css"
8
- }],
9
- plugins: [path.resolve("../..")]
10
- };
3
+ export const css = [{
4
+ source: "./src/index.css",
5
+ target: "./dist/bundle.css"
6
+ }];
7
+
8
+ export const plugins = [resolve(import.meta.dirname, "../..")];
@@ -2,4 +2,8 @@
2
2
 
3
3
  .foo {
4
4
  color: green;
5
+
6
+ .baz {
7
+ color: hotpink;
8
+ }
5
9
  }
@@ -1 +1 @@
1
- .bar{color:red}.foo{color:green}
1
+ .bar{color:red}.foo{color:green}
@@ -1,10 +1,8 @@
1
- "use strict";
2
- let path = require("path");
1
+ import { resolve } from "node:path";
3
2
 
4
- module.exports = {
5
- css: [{
6
- source: "./src/index.css",
7
- target: "./dist/bundle.css"
8
- }],
9
- plugins: [path.resolve("../..")]
10
- };
3
+ export const css = [{
4
+ source: "./src/index.css",
5
+ target: "./dist/bundle.css"
6
+ }];
7
+
8
+ export const plugins = [resolve(import.meta.dirname, "../..")];
@@ -1,5 +1,5 @@
1
1
  body:before {
2
- content: "\26a0 CSS Error: src/index.css:2:2: Unknown word color";
2
+ content: "\26a0 CSS Error: src/index.css:2:7: Expected identifier but found whitespace";
3
3
  font-weight: bold;
4
4
  display: block;
5
5
  border: 5px solid red;
@@ -1,10 +1,8 @@
1
- "use strict";
2
- let path = require("path");
1
+ import { resolve } from "node:path";
3
2
 
4
- module.exports = {
5
- css: [{
6
- source: "./src/index.css",
7
- target: "./dist/bundle.css"
8
- }],
9
- plugins: [path.resolve("../..")]
10
- };
3
+ export const css = [{
4
+ source: "./src/index.css",
5
+ target: "./dist/bundle.css"
6
+ }];
7
+
8
+ export const plugins = [resolve(import.meta.dirname, "../..")];
@@ -1,7 +1,9 @@
1
+ /* src/lib.css */
1
2
  .bar {
2
- color: red;
3
+ color: red;
3
4
  }
4
5
 
6
+ /* src/index.css */
5
7
  .foo {
6
- color: green;
8
+ color: green;
7
9
  }
@@ -1 +1 @@
1
- {"dist/fingerprint/bundle.css":"/assets/dist/fingerprint/bundle-12c46b3f47e2c83fc4f31fb2d6564c51.css","dist/no-fingerprint/bundle.css":"/assets/dist/no-fingerprint/bundle.css"}
1
+ {"dist/fingerprint/bundle.css":"/assets/dist/fingerprint/bundle-dabc1c684fd0fcf8aa3655ba0a1af7e268153ce4e73cb524b4507dce403d5557.css","dist/no-fingerprint/bundle.css":"/assets/dist/no-fingerprint/bundle.css"}
@@ -1,18 +1,17 @@
1
- "use strict";
2
- let path = require("path");
1
+ import { resolve } from "node:path";
3
2
 
4
- module.exports = {
5
- css: [{
6
- source: "./src/index.css",
7
- target: "./dist/fingerprint/bundle.css"
8
- }, {
9
- source: "./src/index.css",
10
- target: "./dist/no-fingerprint/bundle.css",
11
- fingerprint: false
12
- }],
13
- manifest: {
14
- target: "./dist/manifest.json",
15
- value: f => `/assets/${f}`
16
- },
17
- plugins: [path.resolve("../..")]
3
+ export const css = [{
4
+ source: "./src/index.css",
5
+ target: "./dist/fingerprint/bundle.css"
6
+ }, {
7
+ source: "./src/index.css",
8
+ target: "./dist/no-fingerprint/bundle.css",
9
+ fingerprint: false
10
+ }];
11
+
12
+ export const manifest = {
13
+ target: "./dist/manifest.json",
14
+ value: f => `/assets/${f}`
18
15
  };
16
+
17
+ export const plugins = [resolve(import.meta.dirname, "../..")];
@@ -1,8 +1,9 @@
1
+ /* src/lib.css */
1
2
  .bar {
2
- color: red;
3
+ color: red;
3
4
  }
4
5
 
6
+ /* src/index.css */
5
7
  .foo {
6
- color: green;
8
+ color: green;
7
9
  }
8
-
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version":3,
3
3
  "names":[],
4
- "mappings":"AAAA;CACC,UAAU;AACX;;ACAA;CACC,YAAY;AACb",
4
+ "mappings":";AAAA,CAAC;AACA,SAAO;AACR;;;ACAA,CAAC;AACA,SAAO;AACR;",
5
5
  "sourcesContent":[
6
6
  ".bar {\n\tcolor: red;\n}\n",
7
7
  "@import \"./lib.css\";\n\n.foo {\n\tcolor: green;\n}\n"
@@ -1,10 +1,8 @@
1
- "use strict";
2
- let path = require("path");
1
+ import { resolve } from "node:path";
3
2
 
4
- module.exports = {
5
- css: [{
6
- source: "./src/index.css",
7
- target: "./dist/bundle.css"
8
- }],
9
- plugins: [path.resolve("../..")]
10
- };
3
+ export const css = [{
4
+ source: "./src/index.css",
5
+ target: "./dist/bundle.css"
6
+ }];
7
+
8
+ export const plugins = [resolve(import.meta.dirname, "../..")];
@@ -0,0 +1,12 @@
1
+ /* src/lib.css */
2
+ .bar {
3
+ color: red;
4
+ }
5
+
6
+ /* src/index.css */
7
+ .foo {
8
+ color: green;
9
+ }
10
+ .foo .baz {
11
+ color: hotpink;
12
+ }
@@ -0,0 +1,9 @@
1
+ import { resolve } from "node:path";
2
+
3
+ export const css = [{
4
+ source: "./src/index.css",
5
+ target: "./dist/bundle.css",
6
+ transform: ["nesting"]
7
+ }];
8
+
9
+ export const plugins = [resolve(import.meta.dirname, "../..")];
@@ -0,0 +1,9 @@
1
+ @import "./lib.css";
2
+
3
+ .foo {
4
+ color: green;
5
+
6
+ .baz {
7
+ color: hotpink;
8
+ }
9
+ }
@@ -0,0 +1,3 @@
1
+ .bar {
2
+ color: red;
3
+ }
@@ -1,13 +0,0 @@
1
- version: 2
2
- updates:
3
- # Maintain dependencies for GitHub Actions
4
- - package-ecosystem: "github-actions"
5
- directory: "/"
6
- schedule:
7
- interval: "daily"
8
-
9
- # Maintain dependencies for npm
10
- - package-ecosystem: "npm"
11
- directory: "/"
12
- schedule:
13
- interval: "daily"
@@ -1,20 +0,0 @@
1
- on:
2
- - push
3
-
4
- jobs:
5
- test:
6
- runs-on: ubuntu-latest
7
- strategy:
8
- matrix:
9
- node-version:
10
- - 20.x
11
- - 24.x
12
- - latest
13
- steps:
14
- - uses: actions/checkout@v5
15
- - uses: actions/setup-node@v6
16
- with:
17
- node-version: ${{ matrix.node-version }}
18
- - run: npm install-test
19
- env:
20
- CI: true
package/lib/asset-url.js DELETED
@@ -1,14 +0,0 @@
1
- let ASSET_URL_PATTERN = /asset-url\(['"]?(.*?)['"]?\)/;
2
-
3
- module.exports = ({ manifest }) => {
4
- return {
5
- postcssPlugin: "postcss-asset-url",
6
- Declaration(decl) {
7
- if(ASSET_URL_PATTERN.test(decl.value)) {
8
- decl.value = decl.value.replace(ASSET_URL_PATTERN,
9
- (match, url) => `url("${manifest.get(url)}")`);
10
- }
11
- }
12
- };
13
- };
14
- module.exports.postcss = true;
@@ -1,55 +0,0 @@
1
- let postcss = require("postcss");
2
- let atImport = require("postcss-import");
3
- let assetURL = require("./asset-url");
4
- let { readFile } = require("node:fs/promises");
5
-
6
- module.exports = function(input, target, assetManager, sourcemaps, browsers, compact) {
7
- let plugins = [
8
- atImport(),
9
- assetURL({ manifest: assetManager.manifest })
10
- ];
11
-
12
- if(compact) {
13
- plugins.push(
14
- require("postcss-discard-comments")(),
15
- require("postcss-normalize-whitespace")()
16
- );
17
- }
18
-
19
- let processor = postcss(plugins);
20
-
21
- let options = {
22
- from: input,
23
- target
24
- };
25
-
26
- if(sourcemaps) {
27
- options.map = { inline: true };
28
- }
29
-
30
- return () => {
31
- return readFile(input).then(code => {
32
- return processor.process(code, options);
33
- }).then(result => {
34
- let warnings = result.warnings();
35
-
36
- if(warnings.length > 0) {
37
- let errorMessage = warnings.
38
- map(warning => warning.toString()).
39
- join("\n");
40
- throw new Error(errorMessage);
41
- }
42
-
43
- let includedFiles = result.messages.
44
- filter(message => message.type === "dependency").
45
- map(message => message.file);
46
-
47
- return {
48
- css: result.css,
49
- stats: {
50
- includedFiles: [input].concat(includedFiles)
51
- }
52
- };
53
- });
54
- };
55
- };
@@ -1,4 +0,0 @@
1
- .bla {
2
- background: url("/assets/dist/spacer.gif");
3
- color: green;
4
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- let path = require("path");
3
-
4
- module.exports = {
5
- css: [{
6
- source: "./src/index.css",
7
- target: "./dist/bundle.css"
8
- }],
9
- static: [{
10
- source: "./src/spacer.gif",
11
- target: "./dist/spacer.gif"
12
- }],
13
- manifest: {
14
- target: "./dist/manifest.json",
15
- value: f => `/assets/${f}`
16
- },
17
- plugins: [path.resolve("../..")]
18
- };
@@ -1,4 +0,0 @@
1
- .bla {
2
- background: asset-url("dist/spacer.gif");
3
- color: green;
4
- }