Last active
March 2, 2021 15:16
-
-
Save buncis/1d6583b36ab81429c5f5ca4d4c66407b to your computer and use it in GitHub Desktop.
add bootstrap 4.6 to rails 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yarn add bootstrap jquery popper.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file is automatically compiled by Webpack, along with any other files | |
// present in this directory. You're encouraged to place your actual application logic in | |
// a relevant structure within app/javascript and only use these pack files to reference | |
// that code so it'll be compiled. | |
import Rails from "@rails/ujs"; | |
import Turbolinks from "turbolinks"; | |
import * as ActiveStorage from "@rails/activestorage"; | |
import "channels"; | |
import "bootstrap"; | |
Rails.start(); | |
Turbolinks.start(); | |
ActiveStorage.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "bootstrap/scss/bootstrap"; | |
// rename application.css and replace the content with this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { environment } = require("@rails/webpacker"); | |
const webpack = require("webpack"); | |
environment.plugins.append( | |
"Provide", | |
new webpack.ProvidePlugin({ | |
$: "jquery", | |
jQuery: "jquery", | |
Popper: ["popper.js", "default"], | |
}) | |
); | |
module.exports = environment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changes not staged for commit: | |
(use "git add/rm <file>..." to update what will be committed) | |
(use "git restore <file>..." to discard changes in working directory) | |
deleted: app/assets/stylesheets/application.css | |
modified: app/javascript/packs/application.js | |
modified: config/webpack/environment.js | |
modified: package.json | |
modified: yarn.lock | |
Untracked files: | |
(use "git add <file>..." to include in what will be committed) | |
app/assets/stylesheets/application.scss |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment