Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ To install run

``` bash
git clone https://github.com/PyMavs/pymavs.github.io
cd pymavs.github.io
npm install
```

## Pushing Changes
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"doc": "docs"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
},
"repository": {
"type": "git",
Expand All @@ -20,13 +21,14 @@
},
"homepage": "https://github.com/PyMavs/pymavs.github.io#readme",
"devDependencies": {
"node-sass": "^4.9.3",
"css-loader": "^1.0.0",
"mini-css-extract-plugin": "^0.4.4",
"node-sass": "^4.9.4",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.1"
},
"dependencies": {
"css-loader": "^1.0.0",
"style-loader": "^0.23.0"
}
"dependencies": {}
}
1 change: 1 addition & 0 deletions resc/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

275 changes: 275 additions & 0 deletions resc/styles.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './index.scss';

console.log("Welcome! Greetings from app.js. Let's learn Webpack2");
8 changes: 4 additions & 4 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ a{
flex-shrink: 0;
height: 200px;

background: url("./resc/img/py_logo_md.png") no-repeat center;
background: url("../resc/img/py_logo_md.png") no-repeat center;
background-size: contain;
}

Expand Down Expand Up @@ -130,23 +130,23 @@ nav a{
}

#club-image-1{
background: url("./resc/img/live2.jpg") no-repeat center;
background: url("../resc/img/live2.jpg") no-repeat center;
background-size: cover;
height: 200px;
min-width: 300px;

}

#club-image-2{
background: url("./resc/img/live.jpg") no-repeat center;
background: url("../resc/img/live.jpg") no-repeat center;
background-size: cover;
height: 250px;
min-width: 300px;

}

#club-image-3{
background: url("./resc/img/live3.jpg") no-repeat center;
background: url("../resc/img/live3.jpg") no-repeat center;
background-size: cover;
height: 200px;
min-width: 300px;
Expand Down
44 changes: 31 additions & 13 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

module.exports = {
entry: './src/index.scss',
entry: './src/app.js',
output: {
path: path.resolve(__dirname, 'assets'),
filename: 'dist/bundle.js',
path: path.resolve(__dirname, 'resc'),
filename: 'bundle.js',
},
module: {
rules: [{
test: /\.scss$/,
use: [{
"style-loader",
"css-loader", // translate CSS into common js
"sass-loader" // compiles sass to css

}]
}]
}
rules: [
{
test: /\.scss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: '../',
useRelativePaths: true
}
},
'css-loader',
'sass-loader'
]
},
{
test: /\.(png|woff|woff2|eot|ttf|svg|jpg)$/,
use: { loader: 'url-loader', },
}
]
},
plugins: [
new MiniCssExtractPlugin({
path: path.resolve(__dirname, 'resc'),
filename: 'styles.css'
})
]
};


Expand Down