Browse Source

Sass compiling

master
Nathan Bergey 6 years ago
parent
commit
330d5eceb4
  1. 2
      README.markdown
  2. 14
      dist/index.html
  3. 5
      package.json
  4. 2
      src/style.sass
  5. 43
      webpack.config.js

2
README.markdown

@ -5,7 +5,7 @@ Weather Dashboard
Install all the dependencies for the project with Install all the dependencies for the project with
$ npm install dev
$ npm install
## Build ## Build

14
dist/index.html

@ -1,10 +1,20 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>Getting Started</title>
<title>Weather for Philadelphia, PA</title>
<link rel="stylesheet" type="text/css" href="style.css" >
</head> </head>
<body> <body>
<svg id="chart"></svg>
<div class="wrapper">
<header>
<h1 class="title">Weather for <span class="city">Philadelphia, PA</span></h1>
</header>
<svg id="chart"></svg>
</div>
<footer>
<p>Made by natronics in the cold industrial blocks of Philadelphia PA.</p>
</footer>
<script src="main.js"></script> <script src="main.js"></script>
</body> </body>
</html> </html>

5
package.json

@ -16,6 +16,11 @@
"d3-fetch": "^1.1.2" "d3-fetch": "^1.1.2"
}, },
"devDependencies": { "devDependencies": {
"css-loader": "^2.1.0",
"extract-loader": "^3.1.0",
"file-loader": "^3.0.1",
"node-sass": "^4.11.0",
"sass-loader": "^7.1.0",
"webpack": "^4.28.4", "webpack": "^4.28.4",
"webpack-cli": "^3.2.1" "webpack-cli": "^3.2.1"
} }

2
src/style.sass

@ -0,0 +1,2 @@
body
background: #fc2

43
webpack.config.js

@ -1,9 +1,38 @@
const path = require('path'); const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
}
};
module.exports = [{
name: 'js',
entry: ['./src/index.js'],
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
}
},
{
name: 'css',
entry: ['./src/style.sass'],
module: {
rules: [
{
test: /\.sass$/,
use: [
{
loader: 'file-loader',
options: {
name: 'style.css',
}
},
{
loader: 'extract-loader'
},
{
loader: 'css-loader?-url'
},
{
loader: 'sass-loader'
}
]
}
]
}
}];
Loading…
Cancel
Save