Skip to content

Commit 47d6b45

Browse files
committed
sass with netlify build
1 parent bfe2dbe commit 47d6b45

File tree

8 files changed

+32
-42
lines changed

8 files changed

+32
-42
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
.DS_Store
1313
.AppleDouble
1414
.LSOverride
15+
16+
# Local Netlify folder
17+
.netlify

netlify.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[build]
2+
command = "npm run build"
3+
publish = "dist"
4+
5+
[context.production]
6+
environment = { NODE_VERSION = "10.15.3", NODE_ENV = "production" }
7+
8+
[dev]
9+
command = "npm run start"
10+
publish = "dist"
11+
port = 3000
12+
targetPort = 8181
13+
NODE_ENV = "development"
14+
15+
# Using the `.toml` version of this config file as plugins don't seem to work with the .yml style.
16+
[[plugins]]
17+
package = "/plugins/sass"

netlify.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,12 @@
99
"url": "https://github.com/CSS-Tricks/build-process"
1010
},
1111
"scripts": {
12-
"build": "npm-run-all build:css build:html",
13-
"build:css": "node-sass src/site/_includes/css/main.scss > src/site/css/main.css",
14-
"build:html": "eleventy",
15-
"watch": "npm-run-all --parallel watch:css watch:html",
16-
"watch:css": "node-sass --watch src/site/_includes/css/main.scss > src/site/css/main.css",
17-
"watch:html": "eleventy --serve --port=8181",
18-
"start": "npm run watch"
12+
"build": "eleventy",
13+
"start": "netlify dev"
1914
},
2015
"dependencies": {
2116
"@11ty/eleventy": "^0.10.0",
2217
"html-minifier": "^4.0.0",
23-
"node-sass": "^4.13.1",
24-
"npm-run-all": "^4.1.5"
25-
},
26-
"devDependencies": {
27-
"@netlify/plugin-sitemap": "^0.1.0"
18+
"node-sass": "^4.13.1"
2819
}
2920
}

plugins/doThing/index.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

plugins/sass/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
onPreBuild: async ({ utils: { run } }) => {
3+
await run.command(
4+
"node-sass src/site/_includes/css/main.scss src/site/css/main.css"
5+
);
6+
},
7+
};

plugins/sass/manifest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
name: sass

src/site/_includes/css/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ html {
1111
--yellow: #fff72c;
1212

1313
font: 1.2rem/1.3 "PT Serif", serif;
14-
font-weight: bold;
14+
font-weight: bolder;
1515
background: #1b1b1b;
1616
color: white;
1717
}

0 commit comments

Comments
 (0)