Mba'yrupehẽ
Eikuaa mba’éichapa ikatu emoinge Bootstrap nde proyecto-pe eipuruhápe Parcel.
Oñemoĩ Parcela
Oñemohenda Paquete Paquete rehegua .
Emoĩ Bootstrap
Emohenda bootstrap peteĩ Node.js módulo ramo eipuruhápe npm.
Bootstrap odepende Popper rehe , ojehechaukáva peerDependencies
propiedad-pe. Péva he’ise rejeasegurava’erãha remoĩ mokõivéva nde package.json
jeporúpe npm install @popperjs/core
.
Oñemohu’ãvo opa mba’e, ne proyecto oñembosako’íta péicha:
project-name/
├── build/
├── node_modules/
│ └── bootstrap/
│ └── popper.js/
├── scss/
│ └── custom.scss
├── src/
│ └── index.html
│ └── index.js
└── package.json
Ojegueru jave JavaScript
Egueru Bootstrap JavaScript nde app jeikeha rendaguépe (jepivegua src/index.js
). Ikatu emoinge opaite ore plugin peteĩ vore’ípe térã peteĩteĩ reikotevẽramo peteĩ subconjunto añoite umívagui.
// Import all plugins
import * as bootstrap from 'bootstrap';
// Or import only needed plugins
import { Tooltip as Tooltip, Toast as Toast, Popover as Popover } from 'bootstrap';
// Or import just one
import Alert as Alert from '../node_modules/bootstrap/js/dist/alert';
Ojegueru jave CSS
Eipuru hag̃ua Bootstrap mba’ekuaarã tuichakue ha emohenda hag̃ua ne remikotevẽme, eipuru umi vore ypykue ne proyecto ñembojoaju rembiaporã pehẽngue ramo.
Ejapo nde mba’éva emoinge scss/custom.scss
hag̃ua Bootstrap Sass rembiapokue ha upéi embogue umi mba’e’oka jeporupyre oñemboguapýva .
Omopu’ã app
Oike etiqueta src/index.js
de cierre mboyve .</body>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script src="./index.js"></script>
</body>
</html>
Moambuepackage.json
Ombojoapy dev
ha build
scripts nde package.json
rembiapokue ryepýpe.
"scripts": {
"dev": "parcel ./src/index.html",
"prebuild": "npx rimraf build",
"build": "parcel build --public-url ./ ./src/index.html --experimental-scope-hoisting --out-dir build"
}
Emoñepyrũ dev script
Nde app ojeikekuaa ko’ápe http://127.0.0.1:1234
.
npm run dev
Omopu’ã umi archivo app rehegua
Umi archivo oñemopu’ãva oĩ pe build/
carpeta-pe.
npm run build