Skip to content

Commit aadda78

Browse files
committed
Primeiro commit público do guia do Webpack
1 parent 785de5c commit aadda78

27 files changed

+18112
-0
lines changed

capa.png

766 KB
Loading

code/assets/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/*
Binary file not shown.

code/assets/dist/bundle.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading

code/assets/dist/index.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html>
2+
<head>
3+
<title>Webpack com Assets</title>
4+
</head>
5+
<body>
6+
<div id="slogan"></div>
7+
<script src="bundle.js"></script>
8+
</body>
9+
</html>

code/assets/package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "code",
3+
"version": "1.0.0",
4+
"description": "Exemplo de projeto usando o Webpack",
5+
"main": "index.js",
6+
"scripts": {
7+
"build": "webpack",
8+
"build:prod": "webpack -p"
9+
},
10+
"keywords": [
11+
"Itexto",
12+
"guias da Itexto"
13+
],
14+
"author": "Henrique Lobo Weissmann",
15+
"license": "ISC",
16+
"devDependencies": {
17+
"css-loader": "^0.28.4",
18+
"file-loader": "^0.11.2",
19+
"style-loader": "^0.18.2",
20+
"webpack": "^3.0.0"
21+
},
22+
"dependencies": {
23+
"loadash": "0.0.1"
24+
}
25+
}

code/assets/src/OpenSans-Light.ttf

217 KB
Binary file not shown.

code/assets/src/estilo.css

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@font-face {
2+
font-family: 'Open Sans', sans-serif;
3+
src: url('./OpenSans-Light.ttf');
4+
font-weight: 300;
5+
font-style: normal;
6+
}
7+
body {
8+
background-color: black;
9+
color: white;
10+
font-family: 'Open Sans', sans-serif;
11+
}
12+
13+
#slogan {
14+
min-height: 220px;
15+
width: 646px;
16+
background: url('./imagem.png');
17+
}

code/assets/src/imagem.png

17.3 KB
Loading

code/assets/src/index.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import _ from 'lodash';
2+
import './estilo.css'
3+
import Imagem from './imagem.png'
4+
5+
function component() {
6+
var element = document.createElement('div');
7+
8+
9+
element.innerHTML = _.join(['Oi', 'Itexto!'], ' ');
10+
11+
return element;
12+
}
13+
14+
document.body.appendChild(component());

code/assets/webpack.config.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
var path = require('path');
2+
3+
module.exports = {
4+
entry: './src/index.js',
5+
output: {
6+
filename: 'bundle.js',
7+
path: path.resolve(__dirname, 'dist')
8+
},
9+
module: {
10+
rules:[
11+
{
12+
test: /\.css$/,
13+
use: ['style-loader', 'css-loader']
14+
},
15+
{
16+
test: /\.(png|svg|jpg|gif)$/,
17+
use: ['file-loader']
18+
},
19+
{
20+
test: /\.(ttf|woff2|woff|eot|otf)$/,
21+
use: ['file-loader']
22+
}
23+
]
24+
}
25+
};

code/inicio/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/*

0 commit comments

Comments
 (0)